Forum


11:32

Moderators
08/10/2009

One way to do it is to pass the selected rows as a javascript array, and then hook the gridComplete event, where you can set selected rows based on the values in the array, e.g. something along the lines of
jQuery('#JQGridID').setGridParam( {gridComplete: function()
{
var grid = jQuery('#JQGridID');
grid.setSelection(selectedRowArray[0],false);
}});
Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller
11:49

27/11/2009

Thanks Rumen,
I've tried something like that but it is dreadfully slow. Here's the code, maybe I'm doing something wrong.
{
var uData = jQuery('#list').getGridParam('userData');
var id_arr=uData.selected.split(",");
for (var i=0;i<=id_arr.length;i++)
{
jQuery('#list').setSelection(id_arr[i],false);
}
}
12:49

Moderators
30/10/2007

Hello,
It depends how many data you loop.
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.
16:23

27/11/2009

Thanks Tony.
I don't have that much data - about 500 rows. Firefox gives me that "a script is running slowly" message after only about 120 records.
It would be really great if in the data I'm returning I could add an attribute to the row element that jqgrid would use to select the row - something like "<row id='1234' selected='Y'>". Then jqgrid could set the value when painting the grid which I assume would be much faster.
Bernie
16:58

Moderators
30/10/2007

Hello,
You can try to use afterInsertRow - where you can set the selection.
Note that in this case gridview mode should be false.
Please let me know if this is faster.
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:
53 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