📄 bitreeviewdatamodel.html
字号:
<!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></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="#getCellIsAnchor">getCellIsAnchor</a></code></td><td>Returns whether the cell is acting as the anchor item in the selection</td></tr><tr><td><code><a href="#getCellIsLead">getCellIsLead</a></code></td><td>Returns whether the cell is acting as the lead item in the selection</td></tr><tr><td><code><a href="#getCellSelected">getCellSelected</a></code></td><td>Returns whether the cell is selected</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="#getDropDataTypes">getDropDataTypes</a></code></td><td>Returns the supported data types for the cell. Return <code>[]</code> or <code>null</code> if no drop is desired on the cll</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="#getHeaderCellStyle">getHeaderCellStyle</a></code></td><td>This allows a custom CSS text to be applied to a header cell. This allows more detailed control over the rendering of the header cell.</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="#getIconStyle">getIconStyle</a></code></td><td>Use this to specify some custom CSS to use for the icon image.</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="#getRowHeaderCellStyle">getRowHeaderCellStyle</a></code></td><td>This allows a custom CSS text to be applied to a row header cell. This allows more detailed control over the rendering of the row header cell.</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="#getRowIsAnchor">getRowIsAnchor</a></code></td><td>Returns whether the row is acting as the anchor item in the selection</td></tr><tr><td><code><a href="#getRowIsLead">getRowIsLead</a></code></td><td>Returns whether the row is acting as the lead item in the selection</td></tr><tr><td><code><a href="#getRowSelected">getRowSelected</a></code></td><td>Returns whether the row at y is selected</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><table><thead><tr><td>Name</td><td>Type</td><td class="bubbles-header">Bubbles</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="datachanged"></a><code>datachanged</code></td><td><code class="type"> <code><a href="BiTreeViewDataModelEvent.html">BiTreeViewDataModelEvent</a></code> </code></td><td class="bubbles-column"></td><td>This event is fired when the data has changed.</td></tr></tbody></table><h2>Static Methods</h2><p>None.</p><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p> </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="getCellIsAnchor"></a>getCellIsAnchor</h3><p>Returns whether the cell is acting as the anchor item in the selection</p><h4>Syntax</h4><pre class="method-syntax">object.getCellIsAnchor(<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">Boolean</code></p><h3><a name="getCellIsLead"></a>getCellIsLead</h3><p>Returns whether the cell is acting as the lead item in the selection</p><h4>Syntax</h4><pre class="method-syntax">object.getCellIsLead(<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">Boolean</code></p><h3><a name="getCellSelected"></a>getCellSelected</h3><p>Returns whether the cell is selected</p><h4>Syntax</h4><pre class="method-syntax">object.getCellSelected(<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -