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
[Subgrid] Collapse all rows before expand a new one = problem
25/11/2013
17:34
Avatar
Adriien M
France
Member
Members
Forum Posts: 9
Member Since:
05/06/2013
sp_UserOfflineSmall Offline

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 :

subGridBeforeExpand 13722 <- First open
subGridRowExpanded 13722
subGridBeforeExpand 13723 <- Second open
subGridRowExpanded 13722 <- Wrong id caused by collapseSubGridRow

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

27/11/2013
10:17
Avatar
Adriien M
France
Member
Members
Forum Posts: 9
Member Since:
05/06/2013
sp_UserOfflineSmall Offline

Nobody?

16/12/2013
12:40
Avatar
Adriien M
France
Member
Members
Forum Posts: 9
Member Since:
05/06/2013
sp_UserOfflineSmall Offline

Up! Laugh

17/12/2013
12:41
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

17/12/2013
14:38
Avatar
Adriien M
France
Member
Members
Forum Posts: 9
Member Since:
05/06/2013
sp_UserOfflineSmall Offline

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

Regards

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information