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
Track selected row
16/12/2009
22:12
Avatar
queen3
Guest
Guests

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.

18/12/2009
20:46
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information