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
Scroll and multiselect
11/03/2010
16:21
Avatar
SimonL
Member
Members
Forum Posts: 39
Member Since:
23/07/2009
sp_UserOfflineSmall Offline

Hi,

I have set scroll: true and multiselect: true on my grid. When miultiselect is set to true and I tick the check box at the top of the column, then any rows visible in the grid are automatically selected. If you then scroll and more rows appear in the grid they are not selected. I can understand why, because of course as you scroll there is an ajax request back to the server to fetch more rows.

But I'm trying to acheive a scenario where if you click the checkbox at the top of the row then all rows are selected (and a getGridParam('selarrow') would return all rows. Is this possible?

Regards,

Simon

11/03/2010
23:41
Avatar
tjones1105
Member
Members
Forum Posts: 18
Member Since:
25/02/2010
sp_UserOfflineSmall Offline

It's funny because I just logged in to the forums to ask the same thing...

Tom

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

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

Hello,

To be a honest no. You can maybe use gridComplete to select it, but automatically no.

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
14:05
Avatar
SimonL
Member
Members
Forum Posts: 39
Member Since:
23/07/2009
sp_UserOfflineSmall Offline

Hi Tony,

I am now making use of gridComplete as you suggested. As part of my grid definition I have the following: 

        $(gridSelector).jqGrid({

          .......

            onSelectAll: function(aRowids, status) {
                selectAll = status;
            },
            gridComplete: function() {
                if (selectAll) {

                    rows = $(gridSelector).jqGrid('getRowData');
                    $(gridSelector).jqGrid('resetSelection');
                    for (var x = 0; x < rows.length; x++) {
                        $(gridSelector).jqGrid('setSelection', rows[x].rn);
                    }
                    // Multiselect check box on  the grid header
                    $('#cb_g_artist').attr('checked', true);

                }
            }

          ....

If the user checks the "Multiselect" check box on the grid header I set a flag: selectAll = status, which sets it to true if the checkbox is ticked, otherwise false. Then in the gridComplete function as you can see I check this flag and if its true, I unselect anything that was already selected, then reselect everything. This works well - the user has the illusion that as they scroll through the grid everything is selected.

One problem is if the user unselects a row, the "Select All" check box on the grid header remains checked - it should be unchecked at this point. If I use $('#cb_g_artist').attr('checked', false) in the onSelectRow event, it will set the multiselect checkbox to unchecked, but all rows will be unselected as well which is not what I want.

So if any row is deselected, how do I set the multiselect checkbox to unchecked, without unselecting all the rows?

Regards,

Simon

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

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

Hello,

Sorry this is discussed here, for now it is not planed to be changed. We should apply some huge logic.

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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