Forum
17:34
05/06/2013
Hello,
I've got a problem when I collapse all rows before expand a new one, the rowid in subGridRowExpanded is wrong.
Here is my code snippet :
subGridBeforeExpand: function (subgridDivId, rowid) {
console.log("subGridBeforeExpand " + rowid);
var rowIds = $("#grilleCompteTiers").getDataIDs();
$.each(rowIds, function (index, rowId) {
$("#grilleCompteTiers").collapseSubGridRow(rowId);
});
},
subGridOptions: { selectOnExpand : true },
subGridRowExpanded: function (subgridDivId, rowid) {
console.log("subGridRowExpanded " + rowid);
…
}
And here is the output :
I haven't got this issue on the previous version, I don't really know if it's a bug but I think it would be awesome to add a boolean option "collapseAllOnExpand" in subGridOptions.
What do you think?
Best regards
12:41
Moderators
30/10/2007
Hello,
I suppose you will maybe to use setTimeout in order to process the operatins correct.
Regards
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:38
05/06/2013
Hello,
Finally I use this solution, I stop the execution, collapse all rows and open manually the row stocked in 'subgridRow' :
subGridBeforeExpand: function (subgridDivId, rowid) {
if (rowid != subgridRow) {
var grid = $(this);
var rows = grid.jqGrid("getDataIDs");
$.each(rows, function(index, rowId) {
grid.collapseSubGridRow(rowId);
if (index + 1 == rows.length) {
subgridRow = rowid;
grid.expandSubGridRow(rowid);
}
});
return false;
}
return true;
}
I submit the solution, maybe it will be useful for someone else.
Regards
Most Users Ever Online: 715
Currently Online:
39 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