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_Related Related Topics sp_TopicIcon
sorting woes
27/08/2010
20:14
Avatar
jakemonO
Member
Members
Forum Posts: 16
Member Since:
20/08/2010
sp_UserOfflineSmall Offline

I'm using jqGrid 3.7.2. to display data retrieved as JSON from a DWR call. The grid displays flawlessy, but I can't seeem to get it to do client-side sorting no matter what I try. Am I to understand that the grid doesn't sort on remote data? I'm returning a complete result set that is displayed in 1 page and all I want to do is sort what's being displayed in the grid when a user clicks on the column header. Here's my colModel:

colModelDef = [
        {name:'id',label:'id',hidden: true, key: true},
        {name:'nodeType',label:'Action',width:75, key: true, sortable: false},
        {name:'date',label:'Effective Date',width:100, sortable: true, sorttype: 'date', formatter:'date'},
        {name:'location',label:'Location',width:150, key: true, sortable: true, sorttype: 'text'},
        {name:'quantity',label:'Quantity',width:70, sorttype: 'int'},
        {name:'reason',label:'Reason',width:200},
        {name:'comment',label:'Comments',width:400}      
];  

with DWR, I essentially call make the remote call, retrieve the JSON and execute the callback which massages the retrieved data and executes

$(".tableName")[0].addJSONData(tableData)

My Grid function is:

  $(".tableName").jqGrid({
            datatype: doFetch(postdata),
            colModel: colModelDef,
            jsonReader: {
                repeatitems: false
            },

            ondblClickRow: function() {
                row_id = $(".tableName").getGridParam('selrow');
                editNode(row_id)
            },
            sortname: 'date',
            sortorder: 'desc'
        })

Pray tell, what am I missing to get this to sort on the client?

Thanks in adv.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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