Forum


10:40

30/04/2009

Probably something simple that I am not seeing... using a javascript array for data (clientArray if you will) but the setup doesn't pre-sort the grid based on the column selected:
jQuery("#jqgTestDetail").jqGrid({
datatype: "local",
height: 300,
colNames: ['Job name', 'Product', 'PFile', 'Fails', 'Status'],
colModel: [
{ name: 'id', index: 'id', width: 250 },
{ name: 'product', index: 'product', width: 80, align: "center" },
{ name: 'paramslink', index: 'paramslink', width: 40, align: "center" },
{ name: 'fails', index: 'fails', width: 40, align: "center", sortable: true, sorttype: "int" },
{ name: 'status', index: 'status', width: 50, align: "center", formatter: 'link' }
],
imgpath: 'styles/themes/steel/images',
multiselect: true,
caption: 'Test suite job runs status',
shrinkToFit: true,
loadui: "disable",
sortname: "Fails",
sortorder: "desc"
});
var arrTestDetailDataRows = [
{ id: "JOB", product: "foo", paramslink: "->", fails: 1, status: "?" },
{ id: "JOB1", product: "foo", paramslink: "->", fails: 3, status: "?" },
{ id: "JOB2", product: "foo", paramslink: "->", fails: 1, status: "?" },
{ id: "JOB3", product: "foo", paramslink: "->", fails: 4, status: "?" },
{ id: "JOB4", product: "foo", paramslink: "->", fails: 9, status: "?" },
{ id: "JOB5", product: "foo", paramslink: "->", fails: 1, status: "?" },
{ id: "JOB6", product: "foo", paramslink: "->", fails: 129, status: "?" },
{ id: "JOB7", product: "foo", paramslink: "->", fails: 3, status: "?" },
{ id: "JOB8", product: "foo", paramslink: "->", fails: 4, status: "?" },
{ id: "JOB9", product: "foo", paramslink: "->", fails: 13, status: "?" },
{ id: "JOB10", product: "foo", paramslink: "->", fails: 2, status: "?" },
{ id: "JOB11", product: "foo", paramslink: "->", fails: 1, status: "?" }
];
for (var i = 0; i <= arrTestDetailDataRows.length; i++)
jQuery("#jqgTestDetail").addRowData(i + 1, arrTestDetailDataRows[i]);
Anything look suspicious?
Thanks,
alec
08:38

Moderators
30/10/2007

Hello,
Consult the documentation. You need to add a sorttype property (for datatype:'local') in colModel in order to sort work correctly.
Regards
Tony
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.
09:16

30/04/2009

thanks for you message Tony! Your work with this software tool is outstanding, and thanks for the personal attention... you must be very busy.
just curious if you noticed this setting posted above:
{ name: 'fails', index: 'fails', width: 40, align: "center", sortable: true, sorttype: "int" },
Am I declaring the sorttype in correctly?
-Alec
Incidentally, I tried both sortname : "Fails" and "fails" to no avail so far.
09:41

Moderators
30/10/2007

Hello,
Seems that all is correct. Did you mean sort is not correct or at all does not work?
What result do you have?
Which version of jqGrid do you use?
Regards
Tony
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.
11:05

30/04/2009

Hi Tony,
Sadly, I don't remember 🙁
I had some installation issues so I tried almost all of the latest releases at one point or another... unfortunately I cannot compare the date on the jquery.jqgrid.js file because I edited this line for my implementation:
var pathtojsfiles = "scripts/js/"; // need to be ajusted
This is not very helpful, I know...if you know of another way for me to verify the version, please let me know. Otherwise, another piece of data that might ring a bell is that the sortGrid method doesn't seem to work either. I created a workaround for 2 of my jqgrid objects when I used this statement:
jQuery("#mygrid").setGridParam({ sortname: "statusCode", sortorder: "desc" }).trigger("reloadGrid");
Thanks again for any advice.
Alec
14:20

30/04/2009

Hi there,
I have since upgraded to the latest stable release: 3.4.3 and I notice I am still having trouble. In case I wasn't clear before, the sortGrid method, and the setGridParam method, fail to actually sort the grid as designed. The grid doesn't respond to the commands... also, I have trouble when loading a json object with a column of integers - the sortGrid and setGridParam methods do not sort (even with trigger('reload')). The manual interactive sort isn't working with that data either...
... just in case you get a moment... 🙂
Thanks again,
Alec
09:38

Moderators
30/10/2007

Hello,
There is a bug in sortGrid method. Fixed in 3.4.4
Regards
Tony
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.
15:08

Moderators
30/10/2007

Hello,
Actually the version is ready for publishing. The problem is documentation.
Regards
Tony
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:
169 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