Forum
23:41
07/04/2014
I recently updated a project from JQGrid 4.2.0 to 4.6.0 and sort is not working. I also implemented bootstrap 3.0 and didn't make any code changes other than some minor styling so I would assume it should work but it is not. Everything else appears to be working fine except sorting. I did some research online and the common solution appears to be to set loadonce to true and I've tried this and sorting works fine. However, I cannot set loadonce to true since our data sets can exceed 50,000 so multilple loads will be required. Some code snippets is listed below. Thanks in advance.
var colNames = ['', '', '..', 'Name', 'Age', '...', '...', '...'];
colNames.push('Final Time', '', '', '');
var colModel = [
...
{ name: 'Name', index: 'Name', editable: true },
{ name: 'Age', index: 'Age', width: 30, align: 'center', editable: true },
....
];
// for(var j = 0; j < legIds.length; j++) {
// colModel.push({ name: 'Leg' + (j + 1), index: 'Leg' + (j + 1), editable: true, width: 70, align: 'right' });
// }
…
grid = $("#grid");
grid.jqGrid({
url: '/Results/GetData?&courseid=' + courseID,
prmNames: {
rows: 'pageSize',
sort: 'sortOrder',
order: 'sortDir',
nd: null
},
datatype: 'json',
jsonReader : {
id : 'ID',
root: 'entries',
repeatitems: false
},
colNames: colNames,
colModel: colModel,
height: 'auto',
autowidth: true,
altRows: false,
caption: '',
cellEdit: false,
cellsubmit: 'clientArray',
grouping: true,
toolbar: [false, 'top'],
pager: '#pager',
toppager: false,
rowNum: 25,
// rowTotal: 50,
rowList: [25, 50, 100, 250],
viewrecords: true,
onSelectRow: onGridSelectRow,
ondblClickRow: onGridDblClickRow,
onPaging: onGridPaging,
loadComplete: onGridLoadComplete
});
12:27
Moderators
30/10/2007
Hello,
You have a answer in the discussion forum. In the future, please post you problem only once in the appropriate forum.
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
47 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66