Changeset 12050
- Timestamp:
- 10/07/08 19:23:03 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/trunk/web/js/Ext.grid.ColumnModel.override.js
r12046 r12050 3 3 Ext.grid.ColumnModel.override({ 4 4 5 //adds in proper disabling of the header menu when enableHdMenu is set to false 5 // adds in proper disabling of the header menu when enableHdMenu is set to 6 // false 6 7 isMenuDisabled : function(col) 7 8 { … … 60 61 { 61 62 c.editor = Ext.ComponentMgr.create(c.editor, 'textfield'); // get 62 // instance63 // from64 // xtype65 // config,66 // default67 // to68 // textfield63 // instance 64 // from 65 // xtype 66 // config, 67 // default 68 // to 69 // textfield 69 70 } 70 71 // create gridEditor … … 96 97 }, 97 98 98 getSortField : function(col){ 99 return (this.config[col].sortField)?this.config[col].sortField:this.config[col].dataIndex; 99 getSortField : function(col) 100 { 101 return (this.config[col].sortField) ? this.config[col].sortField : this.config[col].dataIndex; 102 }, 103 104 /** 105 * Finds the index of the first matching column for the given dataIndex. 106 * 107 * @param {String} 108 * col The dataIndex to find 109 * @return {Number} The column index, or -1 if no match was found 110 */ 111 findSortIndex : function(dataIndex) 112 { 113 var c = this.config; 114 115 for (var i = 0, len = c.length; i < len; i++) 116 { 117 var index = (c[i].sortField) ? c[i].sortField : c[i].dataIndex; 118 if (index == dataIndex) 119 { 120 return i; 121 } 122 } 123 return -1; 100 124 } 101 125 }); plugins/sfExtjsThemePlugin/trunk/web/js/Ext.grid.GridView.override.js
r12049 r12050 92 92 93 93 // private 94 updateHeaderSortState : function() 95 { 96 var state = this.ds.getSortState(); 97 if (!state) 98 { 99 return; 100 } 101 if (!this.sortState || (this.sortState.field != state.field || this.sortState.direction != state.direction)) 102 { 103 this.grid.fireEvent('sortchange', this.grid, state); 104 } 105 this.sortState = state; 106 var sortColumn = this.cm.findSortIndex(state.field); 107 if (sortColumn != -1) 108 { 109 var sortDir = state.direction; 110 this.updateSortIcon(sortColumn, sortDir); 111 } 112 }, 113 114 // private 94 115 onHeaderClick : function(g, index) 95 116 {