Forum


09:23

Moderators
30/10/2007

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.
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
12:53

Moderators
30/10/2007

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.
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
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66