X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/b37ceabb82336ee82757cd32efe353cfab8ec267..f5240829880f87e0cf581c6a296e436fdef0ef80:/docs/source/GroupingView.html diff --git a/docs/source/GroupingView.html b/docs/source/GroupingView.html index ec114b54..3c5f93dd 100644 --- a/docs/source/GroupingView.html +++ b/docs/source/GroupingView.html @@ -7,7 +7,7 @@
/*!
- * Ext JS Library 3.2.2
+ * Ext JS Library 3.3.0
  * Copyright(c) 2006-2010 Ext JS, Inc.
  * licensing@extjs.com
  * http://www.extjs.com/license
@@ -158,6 +158,11 @@ var grid = new Ext.grid.GridPanel({
      * @cfg {Function} groupRenderer This property must be configured in the {@link Ext.grid.Column} for
      * each column.
      */
+    
+    
/** + * @cfg {Boolean} cancelEditOnToggle True to cancel any editing when the group header is toggled. Defaults to true. + */ + cancelEditOnToggle: true, // private initTemplates : function(){ @@ -240,8 +245,7 @@ var grid = new Ext.grid.GridPanel({ // private renderUI : function(){ - Ext.grid.GroupingView.superclass.renderUI.call(this); - this.mainBody.on('mousedown', this.interceptMouse, this); + var markup = Ext.grid.GroupingView.superclass.renderUI.call(this); if(this.enableGroupingMenu && this.hmenu){ this.hmenu.add('-',{ @@ -262,6 +266,7 @@ var grid = new Ext.grid.GridPanel({ } this.hmenu.on('beforeshow', this.beforeMenuShow, this); } + return markup; }, processEvent: function(name, e){ @@ -332,7 +337,9 @@ var grid = new Ext.grid.GridPanel({ 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); + if (this.cancelEditOnToggle !== false) { + this.grid.stopEditing(true); + } this.state[gel.id] = expanded; gel[expanded ? 'removeClass' : 'addClass']('x-grid-group-collapsed'); } @@ -363,20 +370,12 @@ var grid = new Ext.grid.GridPanel({ this.toggleAllGroups(false); }, - // private - interceptMouse : function(e){ - var hd = e.getTarget('.x-grid-group-hd', this.mainBody); - if(hd){ - e.stopEvent(); - this.toggleGroup(hd.parentNode); - } - }, - // private getGroup : function(v, r, groupRenderer, rowIndex, colIndex, ds){ - var g = groupRenderer ? groupRenderer(v, {}, r, rowIndex, colIndex, ds) : String(v); + var column = this.cm.config[colIndex], + g = groupRenderer ? groupRenderer.call(column.scope, v, {}, r, rowIndex, colIndex, ds) : String(v); if(g === '' || g === ' '){ - g = this.cm.config[colIndex].emptyGroupText || this.emptyGroupText; + g = column.emptyGroupText || this.emptyGroupText; } return g; }, @@ -396,6 +395,32 @@ var grid = new Ext.grid.GridPanel({ this.updateGroupWidths(); } }, + + afterRenderUI: function () { + Ext.grid.GroupingView.superclass.afterRenderUI.call(this); + + if (this.enableGroupingMenu && this.hmenu) { + this.hmenu.add('-',{ + itemId:'groupBy', + text: this.groupByText, + handler: this.onGroupByClick, + scope: this, + iconCls:'x-group-by-icon' + }); + + if (this.enableNoGroups) { + this.hmenu.add({ + itemId:'showGroups', + text: this.showGroupsText, + checked: true, + checkHandler: this.onShowGroupsClick, + scope: this + }); + } + + this.hmenu.on('beforeshow', this.beforeMenuShow, this); + } + }, // private renderRows : function(){