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
setCell and sort problem
01/09/2010
02:03
Avatar
john.allred
Member
Members
Forum Posts: 4
Member Since:
01/09/2010
sp_UserOfflineSmall Offline

I'm having a problem where I set the data in a cell (that works fine) and then sort the grid. For some reason when I sort the grid the data in the cell reverts back to what it was before I called setCell. This worked fine prior to jqgrid 3.7, so I believe it is an issue that was introduced as part of the local changes.

My guess is that there is an internal array jqgrid maintains to do local sorting. When I call setCell, the grid is updated, but the internal array is not updated. When the sort happens it works with the internal array which resets the cell's data.

Does that sound right? Is there a way to update the internal array (if there is an internal array)?

$("#myGrid").jqGrid('setCell', rowId, 'typesort', data.TYPESORT, '', {title: ''});

$("#myGrid").jqGrid('setGridParam', {datatype:'local'});

$("#myGrid").jqGrid('sortGrid', 'framesort', true);

01/09/2010
02:20
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Try to use

$("#myGrid")[0].refreshIndex();

after modifying the data. It rebuild some indexes used internally in jqGrid for sorting. See /blog/?page_id=393/help/losing-edited-cell-data-after-paging/ for details

Best regards

Oleg

02/09/2010
00:35
Avatar
john.allred
Member
Members
Forum Posts: 4
Member Since:
01/09/2010
sp_UserOfflineSmall Offline

Thanks Oleg. Unfortunately that didn't fix it. I've reverted back to 3.6.4 so that the code will work again. I'll try again when 3.8 comes out to see if this is fixed.

02/09/2010
17:29
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You should always post a code example or a link which can be used to reproduce your problem. Without this it's very difficult to help you. Moreover If you write only some lines of code you suppose that only this lines are important to fix your problem. In reality it is not seldom that the problem will be somewhere else where you don't suppose at the beginning. For example, such "unimportant" things like !DOCTYPE, versions of jQuery UI, other JavaScript files of the order of JS-files and so on can sometime be the reason of very strange effects. Moreover it's always more "informative" to eat a piece of cake as to read a text which describe its taste.

Regards
Oleg

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information