?? bitreeviewdatamodel.html
字號(hào):
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--
Generated using api.website.xsl version 2003-07-17
-->
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>BiTreeViewDataModel</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">
function showDerivedClasses() {
var ul = document.getElementById("api-derived-classes");
var lis = ul.childNodes;
var l = lis.length;
for (var i = 1; i < l; i++)
lis[i].style.display = "";
lis[0].style.display = "none";
}
</script></head>
<body>
<h1 id="BiTreeViewDataModel">BiTreeViewDataModel</h1>
<p>This defines the interface that is needed for a data model for a <code><a href="BiTreeView.html">BiTreeView.</a></code> This actually implements a dummy data model. Extend this class to create more useful data models</p>
<p>This class extends
<code><a href="BiEventTarget.html">BiEventTarget</a></code>
and therefore all methods and fields available for
<code><a href="BiEventTarget.html">BiEventTarget</a></code>
are also available for <code>BiTreeViewDataModel</code>.</p>
<ul class="partial-class-tree">
<li><code><a href="BiObject.html">BiObject</a></code><ul>
<li><code><a href="BiEventTarget.html">BiEventTarget</a></code><ul><li><code>BiTreeViewDataModel</code><ul id="api-derived-classes"><li><code><a href="BiDataSetDataModel.html">BiDataSetDataModel</a></code></li><li><code><a href="BiGrid2DataModel.html">BiGrid2DataModel</a></code></li><li><code><a href="BiGridDataModel.html">BiGridDataModel</a></code></li><li><code><a href="BiTreeDataModel.html">BiTreeDataModel</a></code></li></ul></li></ul></li></ul>
</li>
</ul>
<h2>Constructor</h2>
<p><code>
new BiTreeViewDataModel()</code></p>
<h3>Parameters</h3>
<p>No parameters.</p>
<h2>Properties</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="get-header">get</td>
<td class="set-header">set</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><a name="columnCount"></a><code>columnCount</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"></td>
<td>The number of columns in the model.</td>
</tr>
<tr>
<td><a name="rowCount"></a><code>rowCount</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"></td>
<td>The number of rows in the model. In case the data model is a tree then this should take collapsed subtrees into account</td>
</tr>
<tr>
<td><a name="sortAscending"></a><code>sortAscending</code></td>
<td><code class="type">Boolean</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"></td>
<td>Whether the currently sorted column is sorted ascending or descending</td>
</tr>
<tr>
<td><a name="sortColumn"></a><code>sortColumn</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"></td>
<td>The column that the model is currently sorted by. Return -1 if no sorting is done.</td>
</tr>
<tr>
<td><a name="treeView"></a><code>treeView</code></td>
<td><code class="type">Number</code></td>
<td class="get-column"><img src="check.png" alt="checked"></td>
<td class="set-column"><img src="check.png" alt="checked"></td>
<td>The number of rows in the model. In case the data model is a tree then this should take collapsed subtrees into account</td>
</tr>
</tbody>
</table>
<h2>Methods</h2>
<table>
<thead>
<tr>
<td>Name</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td><code><a href="#getCanSortColumn">getCanSortColumn</a></code></td>
<td>This returns whether the data model can be sorted by column</td>
</tr>
<tr>
<td><code><a href="#getCellStyle">getCellStyle</a></code></td>
<td>This allows a custom CSS text to be applied to a cell. This allows more detailed control over the rendering of the cell.</td>
</tr>
<tr>
<td><code><a href="#getCellText">getCellText</a></code></td>
<td>This should return the text (HTML string) to show for the cell at (x,y)</td>
</tr>
<tr>
<td><code><a href="#getContextMenu">getContextMenu</a></code></td>
<td>This allows a context menu to be shown when the user invokes the context menu on the cell</td>
</tr>
<tr>
<td><code><a href="#getDepth">getDepth</a></code></td>
<td>The depth of the current row. If the data model describes a tree structure the depth is used to indent the row</td>
</tr>
<tr>
<td><code><a href="#getExpanded">getExpanded</a></code></td>
<td>Returns whether the row is expanded</td>
</tr>
<tr>
<td><code><a href="#getHasChildren">getHasChildren</a></code></td>
<td>Returns whether the row has any children</td>
</tr>
<tr>
<td><code><a href="#getHasIcon">getHasIcon</a></code></td>
<td>Returns whether the cell should display an icon. If this is the case the actual image URI is returned using getIcon</td>
</tr>
<tr>
<td><code><a href="#getHeaderCellText">getHeaderCellText</a></code></td>
<td>This should return the text (HTML string) to show for the header cell at x</td>
</tr>
<tr>
<td><code><a href="#getIcon">getIcon</a></code></td>
<td>Returns the path to the image to show on the cell. This is only called for cells that should have an icon accordingly to getHasIcon</td>
</tr>
<tr>
<td><code><a href="#getParent">getParent</a></code></td>
<td>Returns the row index for the parent. If this represents a flat structure and the the row has no parent then this should return -1</td>
</tr>
<tr>
<td><code><a href="#getRowHeaderCellText">getRowHeaderCellText</a></code></td>
<td>This should return the text (HTML string) to show for the row header cell at y</td>
</tr>
<tr>
<td><code><a href="#getRowStyle">getRowStyle</a></code></td>
<td>This allows a custom CSS text to be applied to the row. This allows more detailed control over the rendering of the row.</td>
</tr>
<tr>
<td><code><a href="#getShownChildrenCount">getShownChildrenCount</a></code></td>
<td>Returns the number of shown descendants. If the data model represents a tree then this is the sum all descendants that are shown.</td>
</tr>
<tr>
<td><code><a href="#getSortFunction">getSortFunction</a></code></td>
<td>Returns a function that compares two rows, looking at column x. The returned function should take 2 arguments and return a number depending on the relative order of the arguments.</td>
</tr>
<tr>
<td><code><a href="#getToolTip">getToolTip</a></code></td>
<td>This should return the tool tip to use for the cell</td>
</tr>
<tr>
<td><code><a href="#setExpanded">setExpanded</a></code></td>
<td>Sets whether the row is expanded. The data model is responsible for taking care of the expanded state. The data model should fire the following <code><a href="BiTreeViewDataModelEvent.html">BiTreeViewDataModelEvent</a></code> events, "beforeexpand", "beforecollapse", "expand" and "collapse" so that the <code><a href="BiTreeView.html">BiTreeView</a></code> can be updated</td>
</tr>
<tr>
<td><code><a href="#sort">sort</a></code></td>
<td>This sorts the data model by column x. This should fire a <code><a href="BiTreeViewDataModelEvent.html">BiTreeViewDataModelEvent</a></code> called "datachanged" if the data changed (or was reordered) so that the <code><a href="BiTreeView.html">BiTreeView</a></code> is correctly redrawn</td>
</tr>
</tbody>
</table>
<h2>Events</h2>
<p>None.</p>
<h2>Static Methods</h2>
<p>None.</p>
<h2>Static Fields</h2>
<p>None.</p>
<h2>Remarks</h2>
<p>None.</p>
<h2>Method Details</h2>
<h3><a name="getCanSortColumn"></a>getCanSortColumn</h3>
<p>This returns whether the data model can be sorted by column</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getCanSortColumn(<span class="methodArgument">x</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>x</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The column index</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Boolean</code></p>
<h3><a name="getCellStyle"></a>getCellStyle</h3>
<p>This allows a custom CSS text to be applied to a cell. This allows more detailed control over the rendering of the cell.</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getCellStyle(<span class="methodArgument">x</span>, <span class="methodArgument">y</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>x</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The column index for the cell</td>
</tr>
<tr>
<td><code>y</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The row index for the cell</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="getCellText"></a>getCellText</h3>
<p>This should return the text (HTML string) to show for the cell at (x,y)</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getCellText(<span class="methodArgument">x</span>, <span class="methodArgument">y</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>x</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The column index for the cell</td>
</tr>
<tr>
<td><code>y</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The row index for the cell</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">String</code></p>
<h3><a name="getContextMenu"></a>getContextMenu</h3>
<p>This allows a context menu to be shown when the user invokes the context menu on the cell</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getContextMenu(<span class="methodArgument">x</span>, <span class="methodArgument">y</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>x</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The column index for the cell</td>
</tr>
<tr>
<td><code>y</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The row index for the cell</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">
<code><a href="BiMenu.html">BiMenu</a></code>
</code></p>
<h3><a name="getDepth"></a>getDepth</h3>
<p>The depth of the current row. If the data model describes a tree structure the depth is used to indent the row</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getDepth(<span class="methodArgument">y</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>y</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The index for the row</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Number</code></p>
<h3><a name="getExpanded"></a>getExpanded</h3>
<p>Returns whether the row is expanded</p>
<h4>Syntax</h4>
<pre class="method-syntax">object.getExpanded(<span class="methodArgument">y</span>)</pre>
<h4>Parameters</h4>
<table>
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td class="optional-header">Optional</td>
<td>Default</td>
<td>Descripton</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>y</code></td>
<td><code class="type">Number</code></td>
<td class="optional-column"></td>
<td></td>
<td>The index for the row</td>
</tr>
</tbody>
</table>
<h4>Return Type</h4>
<p><code class="type">Boolean</code></p>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -