webgui/www/extras/yui-ext/docs/output/YAHOO.ext.grid.DefaultColumnModel.html
JT Smith cfd09a5cb6 upgraded to yui 0.12.0
upgraded to yui-ext 0.33 rc2
2006-11-28 02:23:34 +00:00

882 lines
No EOL
49 KiB
HTML

<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YAHOO.ext.grid.DefaultColumnModel</title>
<link rel="stylesheet" type="text/css" href="../resources/reset.css"/>
<link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="../resources/print.css" media="print">
</head>
<body>
<div class="body-wrap">
<div class="top-tools"><img src="../resources/print.gif" width="16" height="16" align="absmiddle">&nbsp;<a href="YAHOO.ext.grid.DefaultColumnModel.html" target="_blank">Print Friendly</a></div>
<h1>Class YAHOO.ext.grid.DefaultColumnModel</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td>YAHOO.ext.grid</td></tr>
<tr><td class="label">Class:</td><td>DefaultColumnModel</td></tr>
<tr><td class="label">Extends:</td><td><a href="YAHOO.ext.grid.AbstractColumnModel.html">AbstractColumnModel</a></td></tr>
<tr><td class="label">Defined In:</td><td><a href="DefaultColumnModel.js.html">DefaultColumnModel.js</a></td></tr>
</table>
<div class="description">
This is the default implementation of a ColumnModel used by the Grid. It defines
the columns in the grid.
<br>Usage:<br>
<pre><code>
var sort = YAHOO.ext.grid.DefaultColumnModel.sortTypes;
var myColumns = [
{header: "Ticker", width: 60, sortable: true, sortType: sort.asUCString},
{header: "Company Name", width: 150, sortable: true, sortType: sort.asUCString},
{header: "Market Cap.", width: 100, sortable: true, sortType: sort.asFloat},
{header: "$ Sales", width: 100, sortable: true, sortType: sort.asFloat, renderer: money},
{header: "Employees", width: 100, sortable: true, sortType: sort.asFloat}
];
var colModel = new YAHOO.ext.grid.DefaultColumnModel(myColumns);
</code></pre> </div>
<hr />
<a name="properties"></a>
<h2>Public Properties</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Property</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#config">config</a> : Object</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">The config passed into the constructor</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#defaultSortable">defaultSortable</a> : Boolean</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Default sortable of columns which have no sortable specified (defaults to false)</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#defaultWidth">defaultWidth</a> : Number</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">The width of columns which have no width specified (defaults to 100)</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#sortTypes&lt;static&gt;">sortTypes&lt;static&gt;</a> : Object</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">&lt;static&gt; Defines the default sorting (casting?) comparison functions used when sorting data:
&nbsp;&nbsp;sortTy...</td>
</tr>
</table>
<a name="methods"></a>
<h2>Public Methods</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Method</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#DefaultColumnModel">DefaultColumnModel</a>(<code>Object config</code>)</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc"></td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#addListener">addListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>boolean override</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#addListener">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Appends an event handler to this element</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#delayedListener">delayedListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Number delay</code>]</span>) : Function</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#delayedListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Appends an event handler to this element that is delayed the specified number of milliseconds.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#fireEvent">fireEvent</a>(<code>String eventName</code>, <code>Object... args</code>) : Boolean</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#fireEvent">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fires the specified event with the passed parameters (minus the event name).</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getCellEditor">getCellEditor</a>(<code>Number colIndex</code>, <code>Number rowIndex</code>) : Object</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns the editor defined for the cell/column.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getColumnCount">getColumnCount</a>() : Number</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns the number of columns.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getColumnHeader">getColumnHeader</a>(<code>Number col</code>) : String</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns the header for the specified column.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getColumnWidth">getColumnWidth</a>(<code>Number col</code>) : Number</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns the width for the specified column.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getDataIndex">getDataIndex</a>(<code>Number col</code>) : Number</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns the dataIndex for the specified column.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getRenderer">getRenderer</a>(<code>Number col</code>) : Function</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns the rendering (formatting) function defined for the column.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getSortType">getSortType</a>(<code>Number col</code>) : Function</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns the sorting comparison function defined for the column (defaults to sortTypes.none).</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getTotalWidth">getTotalWidth</a>(<code>Boolean includeHidden</code>) : Number</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns the total width of all columns.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isCellEditable">isCellEditable</a>(<code>Number colIndex</code>, <code>Number rowIndex</code>) : Boolean</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns true if the cell is editable.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isFixed">isFixed</a>() : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns true if the column width cannot be changed</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isHidden">isHidden</a>(<code>Number colIndex</code>) : Boolean</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns true if the column is hidden.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isResizable">isResizable</a>() : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns true if the column cannot be resized</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isSortable">isSortable</a>(<code>Number col</code>) : Boolean</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Returns true if the specified column is sortable.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#purgeListeners">purgeListeners</a>() : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#purgeListeners">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Removes all listeners for this object</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#removeListener">removeListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#removeListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Removes a listener</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setColumnHeader">setColumnHeader</a>(<code>Number col</code>, <code>String header</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Sets the header for a column.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setColumnWidth">setColumnWidth</a>(<code>Number col</code>, <code>Number width</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Sets the width for a column.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setDataIndex">setDataIndex</a>(<code>Number col</code>, <code>Number dataIndex</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Sets the dataIndex for a column.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setEditable">setEditable</a>(<code>Number col</code>, <code>Boolean editable</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Sets if a column is editable.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setEditor">setEditor</a>(<code>Number col</code>, <code>Object editor</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Sets the editor for a column.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setHidden">setHidden</a>(<code>Number colIndex</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Sets if a column is hidden.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setRenderer">setRenderer</a>(<code>Number col</code>, <code>Function fn</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr class="alt">
<td class="mdesc">Sets the rendering (formatting) function for a column.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setSortType">setSortType</a>(<code>Number col</code>, <code>Function fn</code>) : void</td>
<td class="msource" rowspan="2">DefaultColumnModel</td>
</tr>
<tr>
<td class="mdesc">Sets the sorting comparison function for a column.</td>
</tr>
</table>
<a name="events"></a>
<h2>Public Events</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Event</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-headerchange">headerchange</a> : (<code>ColumnModel this</code>, <code>Number columnIndex</code>, <code>Number newText</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.grid.AbstractColumnModel.html#event-headerchange">AbstractColumnModel</a></td>
</tr>
<tr>
<td class="mdesc">Fires when the text of a header changes</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-hiddenchange">hiddenchange</a> : (<code>ColumnModel this</code>, <code>Number columnIndex</code>, <code>Number hidden</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.grid.AbstractColumnModel.html#event-hiddenchange">AbstractColumnModel</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fires when a column is hidden or "unhidden"</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-widthchange">widthchange</a> : (<code>ColumnModel this</code>, <code>Number columnIndex</code>, <code>Number newWidth</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.grid.AbstractColumnModel.html#event-widthchange">AbstractColumnModel</a></td>
</tr>
<tr>
<td class="mdesc">Fires when the width of a column changes</td>
</tr>
</table>
<h2 class="mdetail-head">Property Details</h2>
<div class="detail-wrap">
<a name="config"></a>
<div class="mdetail">
<h3>config</i></h3>
<code>public Object config</code>
<div class="mdetail-desc">
The config passed into the constructor </div>
<div class="mdetail-def">This property is defined by DefaultColumnModel.</div>
</div>
<a name="defaultSortable"></a>
<div class="mdetail alt">
<h3>defaultSortable</i></h3>
<code>public Boolean defaultSortable</code>
<div class="mdetail-desc">
Default sortable of columns which have no sortable specified (defaults to false) </div>
<div class="mdetail-def">This property is defined by DefaultColumnModel.</div>
</div>
<a name="defaultWidth"></a>
<div class="mdetail">
<h3>defaultWidth</i></h3>
<code>public Number defaultWidth</code>
<div class="mdetail-desc">
The width of columns which have no width specified (defaults to 100) </div>
<div class="mdetail-def">This property is defined by DefaultColumnModel.</div>
</div>
<a name="sortTypes&lt;static&gt;"></a>
<div class="mdetail alt">
<h3>sortTypes&lt;static&gt;</i></h3>
<code>public Object sortTypes&lt;static&gt;</code>
<div class="mdetail-desc">
&lt;static&gt; Defines the default sorting (casting?) comparison functions used when sorting data:
<br>&nbsp;&nbsp;sortTypes.none - sorts data as it is without casting or parsing (the default)
<br>&nbsp;&nbsp;sortTypes.asUCString - case insensitive string
<br>&nbsp;&nbsp;sortTypes.asDate - attempts to parse data as a date
<br>&nbsp;&nbsp;sortTypes.asFloat
<br>&nbsp;&nbsp;sortTypes.asInt </div>
<div class="mdetail-def">This property is defined by DefaultColumnModel.</div>
</div>
</div>
<a name="DefaultColumnModel"></a>
<h2 class="mdetail-head">Constructor Details</h2>
<div class="detail-wrap">
<div class="mdetail">
<h3>DefaultColumnModel</i></h3>
<code>public function DefaultColumnModel(<code>Object config</code>)</code>
<div class="mdetail-desc">
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>config</code> : Object<div class="sub-desc">The config object</div></li> </ul>
</div>
</div>
</div>
</div>
<h2 class="mdetail-head">Method Details</h2>
<div class="detail-wrap">
<a name="addListener"></a>
<div class="mdetail">
<h3>addListener</i></h3>
<code>public function addListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>boolean override</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this element
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li><li><code>override</code> : boolean<div class="sub-desc">(optional) If true, scope becomes the scope</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#addListener">Observable</a>.</div>
</div>
<a name="delayedListener"></a>
<div class="mdetail alt">
<h3>delayedListener</i></h3>
<code>public function delayedListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Number delay</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this element that is delayed the specified number of milliseconds.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li><li><code>delay</code> : Number<div class="sub-desc">(optional) The number of milliseconds to delay</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Function</code><div class="sub-desc">The wrapped function that was created (can be used to remove the listener)</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#delayedListener">Observable</a>.</div>
</div>
<a name="fireEvent"></a>
<div class="mdetail">
<h3>fireEvent</i></h3>
<code>public function fireEvent(<code>String eventName</code>, <code>Object... args</code>)</code>
<div class="mdetail-desc">
Fires the specified event with the passed parameters (minus the event name).
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#fireEvent">Observable</a>.</div>
</div>
<a name="getCellEditor"></a>
<div class="mdetail alt">
<h3>getCellEditor</i></h3>
<code>public function getCellEditor(<code>Number colIndex</code>, <code>Number rowIndex</code>)</code>
<div class="mdetail-desc">
Returns the editor defined for the cell/column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>colIndex</code> : Number<div class="sub-desc">The column index</div></li><li><code>rowIndex</code> : Number<div class="sub-desc">The row index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Object</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getColumnCount"></a>
<div class="mdetail">
<h3>getColumnCount</i></h3>
<code>public function getColumnCount()</code>
<div class="mdetail-desc">
Returns the number of columns.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Number</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getColumnHeader"></a>
<div class="mdetail alt">
<h3>getColumnHeader</i></h3>
<code>public function getColumnHeader(<code>Number col</code>)</code>
<div class="mdetail-desc">
Returns the header for the specified column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>String</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getColumnWidth"></a>
<div class="mdetail">
<h3>getColumnWidth</i></h3>
<code>public function getColumnWidth(<code>Number col</code>)</code>
<div class="mdetail-desc">
Returns the width for the specified column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Number</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getDataIndex"></a>
<div class="mdetail alt">
<h3>getDataIndex</i></h3>
<code>public function getDataIndex(<code>Number col</code>)</code>
<div class="mdetail-desc">
Returns the dataIndex for the specified column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Number</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getRenderer"></a>
<div class="mdetail">
<h3>getRenderer</i></h3>
<code>public function getRenderer(<code>Number col</code>)</code>
<div class="mdetail-desc">
Returns the rendering (formatting) function defined for the column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Function</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getSortType"></a>
<div class="mdetail alt">
<h3>getSortType</i></h3>
<code>public function getSortType(<code>Number col</code>)</code>
<div class="mdetail-desc">
Returns the sorting comparison function defined for the column (defaults to sortTypes.none).
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Function</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="getTotalWidth"></a>
<div class="mdetail">
<h3>getTotalWidth</i></h3>
<code>public function getTotalWidth(<code>Boolean includeHidden</code>)</code>
<div class="mdetail-desc">
Returns the total width of all columns.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>includeHidden</code> : Boolean<div class="sub-desc">True to include hidden column widths</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Number</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="isCellEditable"></a>
<div class="mdetail alt">
<h3>isCellEditable</i></h3>
<code>public function isCellEditable(<code>Number colIndex</code>, <code>Number rowIndex</code>)</code>
<div class="mdetail-desc">
Returns true if the cell is editable.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>colIndex</code> : Number<div class="sub-desc">The column index</div></li><li><code>rowIndex</code> : Number<div class="sub-desc">The row index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="isFixed"></a>
<div class="mdetail">
<h3>isFixed</i></h3>
<code>public function isFixed()</code>
<div class="mdetail-desc">
Returns true if the column width cannot be changed
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="isHidden"></a>
<div class="mdetail alt">
<h3>isHidden</i></h3>
<code>public function isHidden(<code>Number colIndex</code>)</code>
<div class="mdetail-desc">
Returns true if the column is hidden.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>colIndex</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="isResizable"></a>
<div class="mdetail">
<h3>isResizable</i></h3>
<code>public function isResizable()</code>
<div class="mdetail-desc">
Returns true if the column cannot be resized
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="isSortable"></a>
<div class="mdetail alt">
<h3>isSortable</i></h3>
<code>public function isSortable(<code>Number col</code>)</code>
<div class="mdetail-desc">
Returns true if the specified column is sortable.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="purgeListeners"></a>
<div class="mdetail">
<h3>purgeListeners</i></h3>
<code>public function purgeListeners()</code>
<div class="mdetail-desc">
Removes all listeners for this object
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#purgeListeners">Observable</a>.</div>
</div>
<a name="removeListener"></a>
<div class="mdetail alt">
<h3>removeListener</i></h3>
<code>public function removeListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Removes a listener
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#removeListener">Observable</a>.</div>
</div>
<a name="setColumnHeader"></a>
<div class="mdetail">
<h3>setColumnHeader</i></h3>
<code>public function setColumnHeader(<code>Number col</code>, <code>String header</code>)</code>
<div class="mdetail-desc">
Sets the header for a column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>header</code> : String<div class="sub-desc">The new header</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setColumnWidth"></a>
<div class="mdetail alt">
<h3>setColumnWidth</i></h3>
<code>public function setColumnWidth(<code>Number col</code>, <code>Number width</code>)</code>
<div class="mdetail-desc">
Sets the width for a column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>width</code> : Number<div class="sub-desc">The new width</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setDataIndex"></a>
<div class="mdetail">
<h3>setDataIndex</i></h3>
<code>public function setDataIndex(<code>Number col</code>, <code>Number dataIndex</code>)</code>
<div class="mdetail-desc">
Sets the dataIndex for a column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>dataIndex</code> : Number<div class="sub-desc">The new dataIndex</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setEditable"></a>
<div class="mdetail alt">
<h3>setEditable</i></h3>
<code>public function setEditable(<code>Number col</code>, <code>Boolean editable</code>)</code>
<div class="mdetail-desc">
Sets if a column is editable.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>editable</code> : Boolean<div class="sub-desc">True if the column is editable</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setEditor"></a>
<div class="mdetail">
<h3>setEditor</i></h3>
<code>public function setEditor(<code>Number col</code>, <code>Object editor</code>)</code>
<div class="mdetail-desc">
Sets the editor for a column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>editor</code> : Object<div class="sub-desc">The editor object</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setHidden"></a>
<div class="mdetail alt">
<h3>setHidden</i></h3>
<code>public function setHidden(<code>Number colIndex</code>)</code>
<div class="mdetail-desc">
Sets if a column is hidden.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>colIndex</code> : Number<div class="sub-desc">The column index</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setRenderer"></a>
<div class="mdetail">
<h3>setRenderer</i></h3>
<code>public function setRenderer(<code>Number col</code>, <code>Function fn</code>)</code>
<div class="mdetail-desc">
Sets the rendering (formatting) function for a column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>fn</code> : Function<div class="sub-desc"></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
<a name="setSortType"></a>
<div class="mdetail alt">
<h3>setSortType</i></h3>
<code>public function setSortType(<code>Number col</code>, <code>Function fn</code>)</code>
<div class="mdetail-desc">
Sets the sorting comparison function for a column.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>col</code> : Number<div class="sub-desc">The column index</div></li><li><code>fn</code> : Function<div class="sub-desc"></div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DefaultColumnModel.</div>
</div>
</div>
<h2 class="mdetail-head">Event Details</h2>
<div class="detail-wrap">
<a name="event-headerchange"></a>
<div class="mdetail">
<h3>headerchange</i></h3>
<code>public event headerchange</code>
<div class="mdetail-desc">
Fires when the text of a header changes
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : ColumnModel<div class="sub-desc"></div></li><li><code>columnIndex</code> : Number<div class="sub-desc">The column index</div></li><li><code>newText</code> : Number<div class="sub-desc">The new header text</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.ext.grid.AbstractColumnModel.html#event-headerchange">AbstractColumnModel</a>.</div>
</div>
<a name="event-hiddenchange"></a>
<div class="mdetail alt">
<h3>hiddenchange</i></h3>
<code>public event hiddenchange</code>
<div class="mdetail-desc">
Fires when a column is hidden or "unhidden"
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : ColumnModel<div class="sub-desc"></div></li><li><code>columnIndex</code> : Number<div class="sub-desc">The column index</div></li><li><code>hidden</code> : Number<div class="sub-desc">true if hidden, false otherwise</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.ext.grid.AbstractColumnModel.html#event-hiddenchange">AbstractColumnModel</a>.</div>
</div>
<a name="event-widthchange"></a>
<div class="mdetail">
<h3>widthchange</i></h3>
<code>public event widthchange</code>
<div class="mdetail-desc">
Fires when the width of a column changes
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>this</code> : ColumnModel<div class="sub-desc"></div></li><li><code>columnIndex</code> : Number<div class="sub-desc">The column index</div></li><li><code>newWidth</code> : Number<div class="sub-desc">The new width</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.ext.grid.AbstractColumnModel.html#event-widthchange">AbstractColumnModel</a>.</div>
</div>
</div>
</div>
<hr>
Copyright &copy; 2006 Jack Slocum. All rights reserved.
</body>
</html>