It acts as a centralized manager for controlling the various interface
elements of the view. This includes handling events, such as row and cell
level based DOM events. It also reacts to events from the underlying {@link Ext.selection.Model}
It acts as a centralized manager for controlling the various interface
elements of the view. This includes handling events, such as row and cell
level based DOM events. It also reacts to events from the underlying {@link Ext.selection.Model}
* @author Nicolas Ferrero
*/
Ext.define('Ext.view.Table', {
* @author Nicolas Ferrero
*/
Ext.define('Ext.view.Table', {
// scroll the view to the top
scrollToTop: Ext.emptyFn,
// scroll the view to the top
scrollToTop: Ext.emptyFn,
<span id='Ext-view-Table-method-addElListener'> /**
</span> * Add a listener to the main view element. It will be destroyed with the view.
* @private
<span id='Ext-view-Table-method-addElListener'> /**
</span> * Add a listener to the main view element. It will be destroyed with the view.
* @private
<span id='Ext-view-Table-method-getGridColumns'> /**
</span> * Get the columns used for generating a template via TableChunker.
* See {@link Ext.grid.header.Container#getGridColumns}.
* @private
*/
getGridColumns: function() {
<span id='Ext-view-Table-method-getGridColumns'> /**
</span> * Get the columns used for generating a template via TableChunker.
* See {@link Ext.grid.header.Container#getGridColumns}.
* @private
*/
getGridColumns: function() {
<span id='Ext-view-Table-method-getHeaderAtIndex'> /**
</span> * Get a leaf level header by index regardless of what the nesting
* structure is.
<span id='Ext-view-Table-method-getHeaderAtIndex'> /**
</span> * Get a leaf level header by index regardless of what the nesting
* structure is.
<span id='Ext-view-Table-method-getCell'> /**
</span> * Get the cell (td) for a particular record and column.
* @param {Ext.data.Model} record
<span id='Ext-view-Table-method-getCell'> /**
</span> * Get the cell (td) for a particular record and column.
* @param {Ext.data.Model} record
jln = preppedRecords.length;
// process row classes, rowParams has been deprecated and has been moved
jln = preppedRecords.length;
// process row classes, rowParams has been deprecated and has been moved
if (el) {
me.saveScrollState();
// Grab the col and set the width, css
// class is generated in TableChunker.
// Select composites because there may be several chunks.
if (el) {
me.saveScrollState();
// Grab the col and set the width, css
// class is generated in TableChunker.
// Select composites because there may be several chunks.
+
+ // IE6 and IE7 bug.
+ // Setting the width of the first TD does not work - ends up with a 1 pixel discrepancy.
+ // We need to increment the passed with in this case.
+ if (Ext.isIE6 || Ext.isIE7) {
+ if (header.el.hasCls(Ext.baseCSSPrefix + 'column-header-first')) {
+ w += 1;
+ }
+ }
el.select('.' + Ext.baseCSSPrefix + 'grid-col-resizer-'+header.id).setWidth(w);
el.select('.' + Ext.baseCSSPrefix + 'grid-table-resizer').setWidth(me.headerCt.getFullWidth());
me.restoreScrollState();
el.select('.' + Ext.baseCSSPrefix + 'grid-col-resizer-'+header.id).setWidth(w);
el.select('.' + Ext.baseCSSPrefix + 'grid-table-resizer').setWidth(me.headerCt.getFullWidth());
me.restoreScrollState();
me.removeRowCls(rowIdx, me.selectedItemCls);
me.removeRowCls(rowIdx, me.focusedItemCls);
},
me.removeRowCls(rowIdx, me.selectedItemCls);
me.removeRowCls(rowIdx, me.focusedItemCls);
},
onCellSelect: function(position) {
var cell = this.getCellByPosition(position);
if (cell) {
cell.addCls(this.selectedCellCls);
}
},
onCellSelect: function(position) {
var cell = this.getCellByPosition(position);
if (cell) {
cell.addCls(this.selectedCellCls);
}
},
onCellDeselect: function(position) {
var cell = this.getCellByPosition(position);
if (cell) {
cell.removeCls(this.selectedCellCls);
}
onCellDeselect: function(position) {
var cell = this.getCellByPosition(position);
if (cell) {
cell.removeCls(this.selectedCellCls);
}
onCellFocus: function(position) {
//var cell = this.getCellByPosition(position);
this.focusCell(position);
},
onCellFocus: function(position) {
//var cell = this.getCellByPosition(position);
this.focusCell(position);
},
getCellByPosition: function(position) {
var row = position.row,
column = position.column,
getCellByPosition: function(position) {
var row = position.row,
column = position.column,
if (header && node) {
cellSelector = header.getCellSelector();
cell = Ext.fly(node).down(cellSelector);
if (header && node) {
cellSelector = header.getCellSelector();
cell = Ext.fly(node).down(cellSelector);
</span> * Refresh the grid view.
* Saves and restores the scroll state, generates a new template, stripes rows
* and invalidates the scrollers.
</span> * Refresh the grid view.
* Saves and restores the scroll state, generates a new template, stripes rows
* and invalidates the scrollers.
- refresh: function(firstPass) {
- var me = this,
- table;
-
- //this.saveScrollState();
- me.setNewTemplate();
-
- me.callParent(arguments);
-
- //this.restoreScrollState();
-
- if (me.rendered && !firstPass) {
- // give focus back to gridview
- me.el.focus();
- }
+ refresh: function() {
+ this.setNewTemplate();
+ this.callParent(arguments);
},
processItemEvent: function(record, row, rowIndex, e) {
},
processItemEvent: function(record, row, rowIndex, e) {
(me['onBeforeCell' + map[type]](cell, cellIndex, record, row, rowIndex, e) === false) ||
(me.fireEvent('beforecell' + type, me, cell, cellIndex, record, row, rowIndex, e) === false) ||
(me['onCell' + map[type]](cell, cellIndex, record, row, rowIndex, e) === false) ||
(me['onBeforeCell' + map[type]](cell, cellIndex, record, row, rowIndex, e) === false) ||
(me.fireEvent('beforecell' + type, me, cell, cellIndex, record, row, rowIndex, e) === false) ||
(me['onCell' + map[type]](cell, cellIndex, record, row, rowIndex, e) === false) ||
// fireEvent signature
beforeArgs = feature.getFireEventArgs('before' + prefix + type, me, featureTarget, e);
args = feature.getFireEventArgs(prefix + type, me, featureTarget, e);
// fireEvent signature
beforeArgs = feature.getFireEventArgs('before' + prefix + type, me, featureTarget, e);
args = feature.getFireEventArgs(prefix + type, me, featureTarget, e);