Forum


16:21

23/07/2009

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
21:16

Moderators
30/10/2007

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.
14:05

23/07/2009

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
21:25

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66