89 lines
No EOL
3.7 KiB
HTML
89 lines
No EOL
3.7 KiB
HTML
<html><head><title>AbstractGridView.js</title><link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/></head><body><h1>AbstractGridView.js</h1><pre class="highlighted"><code>Ext.grid.AbstractGridView = <b>function</b>(){
|
|
<b>this</b>.grid = null;
|
|
|
|
<b>this</b>.events = {
|
|
"beforerowremoved" : true,
|
|
"beforerowsinserted" : true,
|
|
"beforerefresh" : true,
|
|
"rowremoved" : true,
|
|
"rowsinserted" : true,
|
|
"rowupdated" : true,
|
|
"refresh" : true
|
|
};
|
|
Ext.grid.AbstractGridView.superclass.constructor.call(<b>this</b>);
|
|
};
|
|
|
|
Ext.extend(Ext.grid.AbstractGridView, Ext.util.Observable, {
|
|
rowClass : "x-grid-row",
|
|
cellClass : "x-grid-cell",
|
|
tdClass : "x-grid-td",
|
|
hdClass : "x-grid-hd",
|
|
splitClass : "x-grid-hd-split",
|
|
|
|
init: <b>function</b>(grid){
|
|
<b>this</b>.grid = grid;
|
|
<b>var</b> cid = <b>this</b>.grid.container.id;
|
|
<b>this</b>.colSelector = "#" + cid + " ." + <b>this</b>.cellClass + "-";
|
|
<b>this</b>.tdSelector = "#" + cid + " ." + <b>this</b>.tdClass + "-";
|
|
<b>this</b>.hdSelector = "#" + cid + " ." + <b>this</b>.hdClass + "-";
|
|
<b>this</b>.splitSelector = "#" + cid + " ." + <b>this</b>.splitClass + "-";
|
|
},
|
|
|
|
getColumnRenderers : <b>function</b>(){
|
|
<b>var</b> renderers = [];
|
|
<b>var</b> cm = <b>this</b>.grid.colModel;
|
|
<b>var</b> colCount = cm.getColumnCount();
|
|
<b>for</b>(var i = 0; i < colCount; i++){
|
|
renderers[i] = cm.getRenderer(i);
|
|
}
|
|
<b>return</b> renderers;
|
|
},
|
|
|
|
getColumnIds : <b>function</b>(){
|
|
<b>var</b> ids = [];
|
|
<b>var</b> cm = <b>this</b>.grid.colModel;
|
|
<b>var</b> colCount = cm.getColumnCount();
|
|
<b>for</b>(var i = 0; i < colCount; i++){
|
|
ids[i] = cm.getColumnId(i);
|
|
}
|
|
<b>return</b> ids;
|
|
},
|
|
|
|
getDataIndexes : <b>function</b>(){
|
|
<b>if</b>(!<b>this</b>.indexMap){
|
|
<b>this</b>.indexMap = <b>this</b>.buildIndexMap();
|
|
}
|
|
<b>return</b> this.indexMap.colToData;
|
|
},
|
|
|
|
getColumnIndexByDataIndex : <b>function</b>(dataIndex){
|
|
<b>if</b>(!<b>this</b>.indexMap){
|
|
<b>this</b>.indexMap = <b>this</b>.buildIndexMap();
|
|
}
|
|
<b>return</b> this.indexMap.dataToCol[dataIndex];
|
|
},
|
|
|
|
<i>/**
|
|
* Set a css style <b>for</b> a column dynamically.
|
|
* @param {Number} colIndex The index of the column
|
|
* @param {String} name The css property name
|
|
* @param {String} value The css value
|
|
*/</i>
|
|
setCSSStyle : <b>function</b>(colIndex, name, value){
|
|
<b>var</b> selector = "#" + <b>this</b>.grid.id + " .x-grid-col-" + colIndex;
|
|
Ext.util.CSS.updateRule(selector, name, value);
|
|
},
|
|
|
|
generateRules : <b>function</b>(cm){
|
|
<b>var</b> ruleBuf = [];
|
|
<b>for</b>(var i = 0, len = cm.getColumnCount(); i < len; i++){
|
|
<b>var</b> cid = cm.getColumnId(i);
|
|
ruleBuf.push(<b>this</b>.colSelector, cid, " {\n", cm.config[i].css, "}\n",
|
|
<b>this</b>.tdSelector, cid, " {\n}\n",
|
|
<b>this</b>.hdSelector, cid, " {\n}\n",
|
|
<b>this</b>.splitSelector, cid, " {\n}\n");
|
|
}
|
|
<b>return</b> Ext.util.CSS.createStyleSheet(ruleBuf.join(""));
|
|
}
|
|
});</code></pre><hr><div style="font-size:10px;text-align:center;color:gray;">Ext - Copyright © 2006-2007 Ext JS, LLC<br />All rights reserved.</div>
|
|
</body></html> |