I have a Model, View, and Controller that will automatically convert a DataTable
to a jQGrid
. It works as expected, unless the DataTable
has only 2 columns. The data is rendered as expected, but the Pager_Left
is forced to a width of 20px regardless of the screen or grid size.
I have tried to step through the code to find where this is happening, but cannot see anywhere I am making it happen.
When I am stepping through, it is after this line of code:
jQuery("#" + "@Model.GridId").jqGrid('navGrid', '#' + '@Model.PagerId', { edit: false, add: false, del: false, refresh: false }, {}, {}, {}, { multipleSearch: true, multipleGroup: false });
that the Pager_Left
shrinks. If I comment out the code, it displays as expected, but then I don't get my custom buttons in the pager.
Exact same code with a wider table produces the expected results. I think jQGrid
has some "feature" that tries to adjust the pager when there aren't many columns, but I don't know how to turn it off.
I can do this:
$('#' + '@Model.PagerId' + '_left').css('width', '');
right after the offending code and it display as expected, but I would rather not hack it with a jQuery
call to remove the style after it is added.
How do I turn off the "feature", or override it using proper jQGrid
settings?