mjlecomte
29 Jun 2009, 12:02 PM
GroupingView has a lot of private methods. I was looking through from another forum question. Looks like a potential useful method could be extracted from a private event handler (moved code shown light grey to new location shown in red):
// private
onBeforeRowSelect : function(sm, rowIndex){
/*
if(!this.enableGrouping){
return;
}
*/
this.toggleRowIndex(rowIndex);
/*
var row = this.getRow(rowIndex);
if(row && !row.offsetParent){
var g = this.findGroup(row);
this.toggleGroup(g, true);
}
*/
},
/**
* Toggle the group at the specified row index.
* @param {Object} rowIndex
*/
toggleRowIndex : function(rowIndex){
if(!this.enableGrouping){
return;
}
var row = this.getRow(rowIndex);
if(row && !row.offsetParent){
var g = this.findGroup(row);
this.toggleGroup(g, true);
}
}
// private
onBeforeRowSelect : function(sm, rowIndex){
/*
if(!this.enableGrouping){
return;
}
*/
this.toggleRowIndex(rowIndex);
/*
var row = this.getRow(rowIndex);
if(row && !row.offsetParent){
var g = this.findGroup(row);
this.toggleGroup(g, true);
}
*/
},
/**
* Toggle the group at the specified row index.
* @param {Object} rowIndex
*/
toggleRowIndex : function(rowIndex){
if(!this.enableGrouping){
return;
}
var row = this.getRow(rowIndex);
if(row && !row.offsetParent){
var g = this.findGroup(row);
this.toggleGroup(g, true);
}
}