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
Maintaining checkbox selections through a page operation
08/02/2010
21:45
Avatar
FusionGuy
Pennsylvania, USA
Member
Members
Forum Posts: 12
Member Since:
08/02/2010
sp_UserOfflineSmall Offline

I have a multi-select jqGrid that I'm using and the user has asked me if there is a way to maintain the list of checked items after the next page is selected.  Is there a way to accomplish this with jqGrid?  Thank you.

10/02/2010
16:02
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You will need to use onPaging event again with getGridParam to obtain the selected rows in multiselect mode.

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.

02/03/2010
23:23
Avatar
hughitt1
Member
Members
Forum Posts: 17
Member Since:
30/01/2009
sp_UserOfflineSmall Offline

Hi Tony,

I am also trying to achieve the same effect of preserving row selection across pages. I tried following you above suggestion with something like:

onPaging: function () {

    $("#grid").jqGrid("getGridParam", "selarrrow");

},

but the result of the above method call is always an empty array, regardless of many items are checked.

I looked through some of the other supported methods, but didn't see anything else that seemed helpful for this purpose.

Is there any chance that this could become part of the the base jqGrid? My guess is that for people using multi-select, it is more helpful to preserve selection across pages and also return items from all pages when the selected items are returned.

Thanks!

Keith

05/03/2010
13:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

This is true, since of the reference to the selected columns which after populating we become empty array.

To work this you should do something like this:

onPaging: function() {

var myselectedrows = $.extend([], $("#grid").jqGrid("getGridParam", "selarrrow"));

}

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.

05/03/2010
18:00
Avatar
hughitt1
Member
Members
Forum Posts: 17
Member Since:
30/01/2009
sp_UserOfflineSmall Offline

Hi Tony,

The above still returns "[]" for me in 3.5.6. Does it work for you?

Best,

Keith

09/03/2010
19:31
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Sorry, it is a my fault. I do not have looked into the code.

It is true. This will not work. I have fixed this and you will have the change tomorrow in GitHub.

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/03/2010
01:07
Avatar
tjones1105
Member
Members
Forum Posts: 18
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

I also can not get this to work in 3.6.4...

15/03/2010
21:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Please use the latest version from GitHub

Here is the fix:

http://github.com/tonytomov/jq.....9d760ac50c

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/2010
13:42
Avatar
hughitt1
Member
Members
Forum Posts: 17
Member Since:
30/01/2009
sp_UserOfflineSmall Offline

Thanks Tony ๐Ÿ™‚

Are there any plans to automate this in future versions of jqGrid?

Best,

Keith

17/03/2010
21:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

When it is in github it means that it will be in the next release.

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.

11/05/2010
17:16
Avatar
hughitt1
Member
Members
Forum Posts: 17
Member Since:
30/01/2009
sp_UserOfflineSmall Offline

I just downloaded 3.6.5 and it works great. In case anyone else runs into the same problem, if the method calls still appear to return [], and you are using a jsonReader to enable jqGrid to read your results, make sure the the "id" field points to a unique field. Otherwise jqGrid will be unable to retrieve information about which boxes are checked.

Best,

Keith

05/02/2011
19:37
Avatar
toucan
Member
Members
Forum Posts: 4
Member Since:
30/01/2011
sp_UserOfflineSmall Offline

Try as I might, I cannot get selections from different pages to persist.  I can confirm the 'myselectedrows' array contains the correct values from the old page, but I do not know what needs to be done to reapply them on the new page.  I was hoping the following events would enable me to get this working, but it did not work.

            onPaging: function() { },
            gridComplete: function() { },

What steps should I follow to get this working?  Basically, I would like to be able to move back and forth on the grid pages, see previous selections and when a 'submit' button is clicked be able to pass all the values back to the server.  Any help would be very much appreciated.

"Everything should be made as simple as possible, but not simpler" รขโ‚ฌโ€œ Albert Einstein

06/02/2011
13:04
Avatar
hughitt1
Member
Members
Forum Posts: 17
Member Since:
30/01/2009
sp_UserOfflineSmall Offline

Hi Toucan,

Here is the code I'm using to keep track of things:

    http://pastebin.com/1Yyf07xA

HTH,

Keith

18/07/2011
14:00
Avatar
ashishkp
India
New Member
Members
Forum Posts: 1
Member Since:
18/07/2011
sp_UserOfflineSmall Offline

http://pastebin.com/1Yyf07xA  has functions like _addIdsToSelectedCache and _removeIdsFromSelectedCache which are not  available in source code, will you be able to help here ?

Can't it be included in Core JQGrid plugin ?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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