Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
sort not working
01/05/2009
10:40
Avatar
aleceiffel1066
Member
Members
Forum Posts: 9
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

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

02/05/2009
08:45
Avatar
mikmikus
Member
Members
Forum Posts: 5
Member Since:
24/04/2009
sp_UserOfflineSmall Offline

I guess Sort is based on colModel not colNames,

so just try:

sortname: "fails" instead of sortname: "Fails"

<?php $live=0; while($live

05/05/2009
08:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

05/05/2009
09:16
Avatar
aleceiffel1066
Member
Members
Forum Posts: 9
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

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.

05/05/2009
09:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

05/05/2009
11:05
Avatar
aleceiffel1066
Member
Members
Forum Posts: 9
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

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

07/05/2009
14:20
Avatar
aleceiffel1066
Member
Members
Forum Posts: 9
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

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/05/2009
09:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

11/05/2009
03:50
Avatar
dforrestca
Member
Members
Forum Posts: 17
Member Since:
27/09/2008
sp_UserOfflineSmall Offline

Hi Tony,

Any idea when you might release 3.4.4?

Thanks

13/05/2009
15:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

19/05/2009
08:25
Avatar
sledge
Member
Members
Forum Posts: 28
Member Since:
07/04/2008
sp_UserOfflineSmall Offline

Could we get an exclusive access to the release [without docs]? Hence it has some vital fixes for my project (and other's apparently)

--
sledge

19/05/2009
08:41
Avatar
aleceiffel1066
Member
Members
Forum Posts: 9
Member Since:
30/04/2009
sp_UserOfflineSmall Offline

Thanks Tony, I'll keep an eye out for 3.4.4 on the releases page.

-alec

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information