tobiu
2 Jan 2010, 12:51 PM
hi together,
this is just a small but helpful override:
/*
* 3.0.3 and 3.1.0
* adding the toggleGroup - event
*/
Ext.grid.GroupingView.override ({
toggleGroup : function(group, expanded){
var gel = Ext.get(group);
expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed');
if(this.state[gel.id] !== expanded){
this.grid.stopEditing(true);
this.state[gel.id] = expanded;
gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');
this.fireEvent('toggleGroup', this, gel, expanded);
}
}
});
whenever you expand / collapse a group of your grid, you can determine the change including the params view, groupEl, expanded.
if i had access to the feature-requests-forum, i would post it there. feel free to move the topic or integrate it in svn.
example-usage: if you combine the Ext.ux.grid.RowEditor with a groupingView, you will notice, that the editor does not hide, when you collapse a group. this solves it:
grid-config
,view: new Ext.grid.GroupingView({
forceFit : true
,markDirty : false
,listeners : {
toggleGroup : function(view, group, expanded){
if(!expanded){
editor.stopEditing(false);
}
}
}
})
kind regards,
tobiu
this is just a small but helpful override:
/*
* 3.0.3 and 3.1.0
* adding the toggleGroup - event
*/
Ext.grid.GroupingView.override ({
toggleGroup : function(group, expanded){
var gel = Ext.get(group);
expanded = Ext.isDefined(expanded) ? expanded : gel.hasClass('x-grid-group-collapsed');
if(this.state[gel.id] !== expanded){
this.grid.stopEditing(true);
this.state[gel.id] = expanded;
gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed');
this.fireEvent('toggleGroup', this, gel, expanded);
}
}
});
whenever you expand / collapse a group of your grid, you can determine the change including the params view, groupEl, expanded.
if i had access to the feature-requests-forum, i would post it there. feel free to move the topic or integrate it in svn.
example-usage: if you combine the Ext.ux.grid.RowEditor with a groupingView, you will notice, that the editor does not hide, when you collapse a group. this solves it:
grid-config
,view: new Ext.grid.GroupingView({
forceFit : true
,markDirty : false
,listeners : {
toggleGroup : function(view, group, expanded){
if(!expanded){
editor.stopEditing(false);
}
}
}
})
kind regards,
tobiu