PDA

View Full Version : [FIXED][3.x] GroupingView groupable show in groups hmenu option



mjlecomte
21 Apr 2009, 4:35 PM
It's either unexpected behavior or bug.

To reproduce change the following in the grouping example:

columns: [
{id:'company',header: "Company", width: 60, sortable: true, dataIndex: 'company'},
{groupable: false, header: "Price", width: 20, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
{header: "Change", width: 20, sortable: true, dataIndex: 'change', renderer: Ext.util.Format.usMoney},
{header: "Industry", width: 20, sortable: true, dataIndex: 'industry'},
{header: "Last Updated", width: 20, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],

Click on the Price column, the show in groups option in the hmenu is still enabled. In the code below, I don't think it should be disabled depending on if the field is grouped or not, I think the point is to disable grouping features from that column, period.



// private
beforeMenuShow : function(){
var field = this.getGroupField();
var g = this.hmenu.items.get('groupBy');
if(g){
g.setDisabled(this.cm.config[this.hdCtxIndex].groupable === false);
}
var s = this.hmenu.items.get('showGroups');
if(s){
// s.setDisabled(!field && this.cm.config[this.hdCtxIndex].groupable === false);
s.setDisabled(this.cm.config[this.hdCtxIndex].groupable === false);
s.setChecked(!!field, true);
}
},


Personally I think the action should be configurable, whether the groupable option is disabled or hidden, but I guess that's a feature request if someone really wanted it.

evant
5 May 2009, 9:45 AM
A fix has been added to SVN, thanks.