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
Problem with setSelection
13/03/2009
08:15
Avatar
Armorfist
Member
Members
Forum Posts: 20
Member Since:
25/10/2008
sp_UserOfflineSmall Offline

Hello,

I'm trying to programatically select rows with setSelection, but i'm having a problem. The code is below:

http://pastebin.com/m2120e557

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.

13/03/2009
10:57
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

13/03/2009
12:02
Avatar
Armorfist
Member
Members
Forum Posts: 20
Member Since:
25/10/2008
sp_UserOfflineSmall Offline

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

16/03/2009
05:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

16/03/2009
17:53
Avatar
Armorfist
Member
Members
Forum Posts: 20
Member Since:
25/10/2008
sp_UserOfflineSmall Offline

Hello tony,

Just sent you an email. Many thanks for your help.

Forgot to mention in the mail that if i use the onPaging event with the same exact code as the gridComplete event and combine them both in the grid, the system works fine.

Thanks

Frederico

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information