Forum



16:08

20/05/2010

I want to use a jqgrid in a form to select one or more items from a potentially extensive list. A multiselect menu is unacceptable because of the length and the need to display a lot of information about the items to be selected. The form is re-entrant, so I need to be able to select the items that were selected the last time that the form was filled out. This is logically equivalent to specifying the selected option(s) in a select tag.
Please forgive me if I have overlooked the answer in the documentation or in my search of the forums. It just seems that this should be fairly simple to do. BTW, you've done a great job providing a quality product.
19:05

Moderators
30/10/2007

Hello,
I'm not sure if I understand right the problem, but you can save the selection in variable (multiselect option of the grid should be enabled and then select it again using setSelection method.
It is important to note that you should save the state of the selected rows this way.
to get the selection
var selectedrows = $.extend([], $("#grid").jqGrid('getGridParam', 'selarrrow'));
to select it again
for(var i=0;i<selectedrows;i++) {
$("#grid").jqGrid('setSelection',selectedrows[i]);
}
Best 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.
Most Users Ever Online: 715
Currently Online:
83 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