ParamQuery grid support forum
General Category => ParamQuery Pro Evaluation Support => Topic started by: Ajay on June 16, 2015, 07:54:33 pm
-
Hi,
I am using evaluation copy of PQGrid.
As per documentation,sorting is enabled by default in both Api documentation and Demos.
When i tried to do the same,sorting is not happening until i add the below line of code.
searchLicenseUsageGrid.pqGrid("option", "dataModel", { data: data, sorting: 'local', sortIndx: 'name' });
Is it necessary to add every time in all the pq grids of the application?
Is there any alternative so that we can achieve with out adding the above line in all the pages?
-
Sorting is enabled by default and default value of dataModel.sorting is "local".
It seems from your code that you have assigned data to grid in a manner which has overwritten default values of dataModel.
pqGrid("option", "dataModel", { data: data }); // this would overwrite the whole dataModel with { data: data} and other properties including dataModel.sorting become undefined.
Correct way to assign data without overwriting other properties.
pqGrid("option", "dataModel.data", data }); // this would not change other properties of dataModel.
-
Thanks it got worked.