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
Pre-selecting rows in a multiselect grid
20/05/2010
16:08
Avatar
johnr
New Member
Members
Forum Posts: 1
Member Since:
20/05/2010
sp_UserOfflineSmall Offline

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.

20/05/2010
19:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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