Forum


22:12

This is born out of this question: http://stackoverflow.com/quest.....ted-record.
I've implemented the thing there, and noticed a useful effect: when I preserve the selected id/row, sorting and filtering does not reset the selected row. So when user looks at "ABC" and clicks sorting, jqGrid remembers row id, sends it to the server so that server can find the page where this "ABC" is (or do it itself for local data), and though order of records is changed user still sees the "ABC" - still highlighted - thus user doesn't lose the context.
I wonder if tracking of selected row is implemented or can be added to jqGrid, such that, given that row with #sel_id is selected:
- sorting keep the selected row on screen. I.e. for A-Z it was on first page, sorting Z-A we display the row highlighted on last page (current page is changed)
- same for filtering, if selected row is presented in filtered data
This can be achieved if jqGrid tracks "selected row id" and sends it to the server. There're problems, however - for example if jqGrid _always_ sends selected id user won't be able to change page at all 😉
Just wonder if there's anything useful in this direction.
20:46

Moderators
30/10/2007

Hello,
If you are on local mode there is a such option - deselectAfterSort, but if you using server side paging and sorting you can do this using the onSelectRow, gridComplete and setSelection events. Use first to store the selection and the other to make the selection when the user sort or etc.
Note: use the second parameter in onSelectRow to remove the selection if the user deselects it.
See docs.
Best Regrds
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:
58 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