So one problem lead to a solution that ended up causing another problem…
Problem #1:
My columns can vary from load to load so I hide/show them accordingly, but also adjust the sorting to a column that's valid on the backend. So if the previously sorted column no longer applies, a new one is chosen. However, jqGrid doesn't look for sorting variables in responses for the column header visuals to update.
Solution:
Within loadComplete I do: grid.jqGrid('sortGrid', data.sortBy, false, data.sortOrder.toLowerCase());
Obviously I don't want to unnecessarily loop things, so a reload isn't performed as part of this command.
Problem #2 (and bug):
Now what's happening is that the typical pagination controls aren't working. It won't advance beyond page 2. If I had to guess I'd say that the sortGrid method causes an internal page variable to reset to page 1. So while the visual still shows page 2, an attempt to move forward one page or backwards doesn't work because it thinks it's on page 1 already.
Thus, these work:
And these don't:
All those behaviors make sense if you assume the logic thinks it's already on page one, which I'd put forth is the bug.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top