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
Column Sorting
29/01/2009
04:44
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

Hello, 

I would imagine that clicking on a column header that is set for sortable:true should toggle the sort order from asc to desc for that column and include it in the POST "sord" parameter when the grid is reloaded from the server. 

In this case, the POST is made when the column header is clicked but the "sord" parameter does not change from Asc to desc. 

Is  there something else that needs to be done to activate this feature?

Rob..

29/01/2009
06:32
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I'm not sure what you try to do but this work well in the demo page. You can check. Also do you have some events defind - by example onPaging.

Also if you click on column1 and then on column2 the first order is asc and the second is again asc

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.

30/01/2009
07:33
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

Hi Tony,

The following is how the grid is configured: (truncated as much as possible)

(”#ETSMonth”).jqGrid({

   url: 'WSGridGetDFSA.aspx',

   datatype: “json”, 

   mtype: 'POST',

   colModel: [

     {label: 'Date', name: 'Day', index: 'DayDate', width: 50, align: 'center' }, 

     {label: 'UWI', name: 'UWI', index: 'UWI', width: 200 },

      ...........40 other columns.........

     {label: 'GRID', name: 'GRID', index: 'GRID', width: 1}        

   ],

   imgpath: 'themes/coffee/images',

   sortname: 'Day',

   sortorder: “Asc”,

   viewrecords: true,

   height: '100%',

   hidegrid: false, 

   cellEdit: true,

   cellsubmit: 'clientArray', 

   cellurl: “WSGridSetDFSA.aspx”,

   afterSaveCell: function(rowid, celname, value, iRow, iCol) { 

        setAssociatedCellValues(rowid, celname, value, iRow, iCol) },

   onSelectCell: function(id, name, val, iRow, iCol) { 

        setStaticCellValues(id, name, val, iRow, iCol); },

   loadComplete: function() { setInitialCaption(); },

        subGrid: true,

   subGridRowExpanded: function(subgrid_id, row_id) {….Working grid as subgrid…},

   caption: “Title bar caption”

 }); //End #ETSMonth

as you can see there is no paging information. The server always returns all the records. Each row represents 1 day in the current month. sidx and page are not used by the server to return records. 
The post looks like the following:
page=1&rows=20&sidx=Day&sord=Asc&nd=1233322639562&_search=false
When the “Day” column header is clicked the grid will post back and “sord” is always whatever the sortorder: option is set to.
Some columns are hidden using the following statement after the Grid Declaration:
            $("#ETSMonth").hideCol(["UWI~Project", "APR", "SubmitDate", "Total", "KMRate", "HQty", "HRate", "LQty", "LRate", "CQty", "CRate", "Other", "MQty", "MRate", "FQty", "FRate", "TQty", "TRate", "MHQty", "MHRate", "HSQty", "HSRate", "NQty", "NRate", "Customer", "Labour", "Month", "Year", "DRID", "WOID", "GRID"]);
 
Thanks again for your help.
Rob…

30/01/2009
09:21
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Try with

sortorder: "asc"

and not with

sortorder: “Asc”

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.

30/01/2009
11:09
Avatar
RobGMiller
Member
Members
Forum Posts: 42
Member Since:
02/01/2009
sp_UserOfflineSmall Offline

Bingo!

Definetly need to pay more attention to case sensitivity of javascript.

Thanks again Tony,

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
45 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