X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/530ef4b6c5b943cfa68b779d11cf7de29aa878bf..b37ceabb82336ee82757cd32efe353cfab8ec267:/pkgs/pkg-grid-grouping-debug.js diff --git a/pkgs/pkg-grid-grouping-debug.js b/pkgs/pkg-grid-grouping-debug.js index f268cf7c..d364074c 100644 --- a/pkgs/pkg-grid-grouping-debug.js +++ b/pkgs/pkg-grid-grouping-debug.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.1 + * Ext JS Library 3.2.2 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -226,7 +226,7 @@ var grid = new Ext.grid.GridPanel({ } if((item = items.get('showGroups'))){ item.setDisabled(disabled); - item.setChecked(this.enableGrouping, true); + item.setChecked(this.canGroup(), true); } }, @@ -263,13 +263,19 @@ var grid = new Ext.grid.GridPanel({ // group value is at the end of the string var field = this.getGroupField(), prefix = this.getPrefix(field), - groupValue = hd.id.substring(prefix.length); + groupValue = hd.id.substring(prefix.length), + emptyRe = new RegExp('gp-' + Ext.escapeRe(field) + '--hd'); // remove trailing '-hd' groupValue = groupValue.substr(0, groupValue.length - 3); - if(groupValue){ + + // also need to check for empty groups + if(groupValue || emptyRe.test(hd.id)){ this.grid.fireEvent('group' + name, this.grid, field, groupValue, e); } + if(name == 'mousedown' && e.button == 0){ + this.toggleGroup(hd.parentNode); + } } },