Mar 26, 2013, 9:32 AM
[CLOSED] Expand/Collapse a group in groupCommand
Hi,
I have a grouped grid that uses a menu item to select/deselect all children of a group.
If the user selects all, I would like to expand the group, if he deselects all I would like to collapse the group.
I have seen an example in the forum where I need to pass a group name as a string, but my groupnames are created dynamically based upon search results.
So this is how I have thought it would work, but it doesnt work.
expand does not throw an exception, but nothing happens.
collapse throws: Uncaught TypeError: Cannot call method 'addCls' of null
I have a grouped grid that uses a menu item to select/deselect all children of a group.
If the user selects all, I would like to expand the group, if he deselects all I would like to collapse the group.
I have seen an example in the forum where I need to pass a group name as a string, but my groupnames are created dynamically based upon search results.
So this is how I have thought it would work, but it doesnt work.
expand does not throw an exception, but nothing happens.
collapse throws: Uncaught TypeError: Cannot call method 'addCls' of null
var onGroupCommand = function (column, command, group) {
if (command === 'SelectAll') {
column.grid.getSelectionModel().select(group.children, true, true);
column.grid.features[0].expand(group);
return;
} else if (command === 'SelectNone') {
column.grid.getSelectionModel().deselect(group.children, true, true);
column.grid.features[0].collapse(group);
return;
}
So whats the right way here?
Last edited by Daniil; Apr 02, 2013 at 4:07 AM.
Reason: [CLOSED]