Forum


08:15

25/10/2008

Hello,
I'm trying to programatically select rows with setSelection, but i'm having a problem. The code is below:
I have a cookie that contains the ID's of all selected rows, so i loop to each visible row to match the id with the cookie to see if its selected, if its true it will call setSelection function to select the row.
This works fine when changing page and searching, but if i change the number of rows per page in the nav bar, it doesnt select any rows, i then click refresh and it selects them properly. I noticed that if i include the same code with onPaging event and use both events at the same time it solves this problem, but it sucks performance wise because it does alot of loops.
10:57

Moderators
30/10/2007

Hello,
Thanks.
In your case this mean that either the selected_jq_ids is null or
the array returned from
currentGridIds = jQuery("#grid_id").getDataIDs() is emty
or at least the data from this array does not match those from cockie.
Could you please tell me which one is true? I see something that maybe should be added whe we use input page element and select box to change the number of records.
Thanks
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.
12:02

25/10/2008

Hello tony,
Neither is true. Thats the strange part. Here's an example of the output of both arrays:
selected_jq_ids:
298,295,290,289,288,287,286,285,284,283
getDataIDs():
298,295,290,289,288,287,286,285,284,283,282,281,280,279,278,
277,276,275,274,273,272,271,270,269,268,267,266,265,264,263
It doesnt select any of them. But this ONLY happens when changing the number of rows in the select box. If i change page or do searches it works fine.
Thanks,
Frederico
05:53

Moderators
30/10/2007

Hello,
If this is the case, then the only thing that I see is: What is going when you loop throught the records (for statements in the event). Could you please use the FireBug to see what is going here. If possible send me a link to the problem - tony at trirand dot com
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:
23 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