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
MultiSelect: Setting Items as Selected On Grid Load
17/09/2008
17:03
Avatar
thatisscary
Member
Members
Forum Posts: 6
Member Since:
07/06/2008
sp_UserOfflineSmall Offline

Is there away in the data to specify that a row is to be selected.

Looking at the rowdata method, it seems that there is no way to do this? 

Am I mistaken?

Matthew

18/09/2008
09:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

getGridParam('selrow')

Retur the currentlly selected row - null otherwise.

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.

18/09/2008
12:41
Avatar
thatisscary
Member
Members
Forum Posts: 6
Member Since:
07/06/2008
sp_UserOfflineSmall Offline

Tony:

I am sorry, I was not clear.  What I want to be able to do is to load

data into the grid, (with Multi Select) and specifiy (at the time of load) in json ( for example),

that a particular row is selected. For example the json for each row would

look like this

 { id:"123454, "selected": "true", "cell":["I am a Selected..." etc.

I poked around the Json data load script, and I know pretty well where this would have to be called.  The call internal call to setSelection( ) seems to be failing at this point, ( this would seem to be the easiest way to handle this, while adding a "checked = checked to the dyanmically created checkbox.),

Anyway, if you can think of a possible shortcut to this,  and point me there I would be more than happy to implement and then share the code. 

Thanks again.  Sorry for the cryptic post previous to this.

Matthew

18/09/2008
12:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Use the undocumented

gridComplete event for this purpose.

It fires after all is done in the grid.

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.

18/09/2008
14:07
Avatar
thatisscary
Member
Members
Forum Posts: 6
Member Since:
07/06/2008
sp_UserOfflineSmall Offline

Tony:

Thanks:

I think what you meant was:

1) add a hidden column to the grid with the name "selected".

2) in the gridComplete function to the following:

          var rowIds = $("#places").getDataIDs ();
                    for( var i = 0; i<rowIds.length ; ++i)
                    {
                        var rowData = $("#places").getRowData( rowIds[i]);
                        if( rowData.selected  == "true")
                        {
                            $("#places").setSelection( rowIds[i]);
                        } 
                    }

It works like a charm.

Thanks,

Matthew

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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