jqGrid: possible to re-assign colNames and colModel upon paging?
Hi jqGrid users:
My colNames and colModel change upon each paging. If you wonder why, it is because the grid data comes from dynamic crosstab, so I never know in advance how many columns I will have.
I do know the maximum number of columns I can have.
So, here is what I am doing: Get all possible column names into colNames (and colModel) and feed it to my jqGrid.
In loadComplete (or gridComplete), I code to hide those columns that do not contain data.
Then in onPaging, I code to show all colNames.
This works Okay.
But, if would be nicer if I can re-assign colNames and colModel to jqGrid upon paging, something like this:
-
onPaging: function (pgButton) {
//$.ajax call to get colNames and colModel and assign them to this current jqGrid
}
Is there anyway to do this with jqGrid?