I am using a grid with loadOnce:true in order to have only one query to the server. The data is sorted on server side (multi-column sorting). Sorting is disabled on client side.
Before activating the grouping feature, navigation was working correctly.
By activating the grouping feature, the first page is OK. But when I go to the next page with the navigation button, the data is sorted on client-side according to the grouping column (even with groupDataSorted:true).
rowTotal: 10000,
gridview: true,
scroll: false,
loadonce: true,
pgbuttons: true,
pginput: true,
rowNum: 100,
rowList: '',
datatype: 'json',
mtype: 'GET',
grouping: true,
groupingView : {
groupField : ['prodNo'],
groupSummary: [true],
groupColumnShow: [false],
groupText: ['({1})'],
showSummaryOnHide: true,
groupDataSorted : true,
groupCollapse: false
},
jsonReader: {root: 'list', userdata : 'list'},
url:'...'
My case is a bit special because I am sorting the data on server side according to a 'name' and 'date' columns, but grouping rows according to another 'prodNo' column. However I do not understand why the sorting is done on page navigation.
Is there a way to disable this client-side sorting on page navigation ?
thanks in advance
If you use
loadonce: true
and the user click on the "Next Page" button the local data will be resorted bygrindexes
(it's the value ofindex
property of the column which you use for grouping ingroupField
). So the easiest way to fix the problem in your case will be to implement custom sorting in theprodNo
column.You can try first to add to the definition of 'prodNo' column the custom sorting
The function
sorttype
will be called during sorting of local data. If it return the same results like in above example then all the data will be interpreted as the same and I hope that no additional sorting will be take place.If the approach will not work because of some reason you can implement another sorting
For example if you want that local data will be sorted based on other columns 'name' and 'date' you can return from the
sorttype
in the 'prodNo' column the value like