1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.tree.TreeSorter-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.tree.TreeSorter-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.tree.TreeSorter-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.tree.TreeSorter-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.tree.TreeSorter"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
9 <h1>Class Ext.tree.TreeSorter</h1>
10 <table cellspacing="0">
11 <tr><td class="label">Package:</td><td class="hd-info">Ext.tree</td></tr>
12 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/TreeSorter.js" target="_blank">TreeSorter.js</a></td></tr>
13 <tr><td class="label">Class:</td><td class="hd-info">TreeSorter</td></tr>
14 <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr>
16 <div class="description">
18 Provides sorting of nodes in a <a ext:cls="Ext.tree.TreePanel" href="output/Ext.tree.TreePanel.html">Ext.tree.TreePanel</a>. The TreeSorter automatically monitors events on the
19 associated TreePanel that might affect the tree's sort order (beforechildrenrendered, append, insert and textchange).
21 <pre><code>new Ext.tree.TreeSorter(myTree, {
24 sortType: <b>function</b>(node) {
25 <i>// sort by a custom, typed attribute:</i>
26 <b>return</b> parseInt(node.id, 10);
28 });</code></pre> </div>
30 <div class="hr"></div>
31 <a id="Ext.tree.TreeSorter-configs"></a>
32 <h2>Config Options</h2>
33 <table cellspacing="0" class="member-table">
35 <th class="sig-header" colspan="2">Config Options</th>
36 <th class="msource-header">Defined By</th>
38 <tr class="config-row">
\r
39 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
41 <a id="Ext.tree.TreeSorter-caseSensitive"></a>
\r
42 <b>caseSensitive</b> : Boolean <div class="mdesc">
\r
43 true for case-sensitive sort (defaults to false) </div>
\r
45 <td class="msource">TreeSorter</td>
\r
47 <tr class="config-row alt">
\r
48 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
50 <a id="Ext.tree.TreeSorter-dir"></a>
\r
51 <b>dir</b> : String <div class="mdesc">
\r
52 The direction to sort ("asc" or "desc," case-insensitive, defaults to "asc") </div>
\r
54 <td class="msource">TreeSorter</td>
\r
56 <tr class="config-row">
\r
57 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
59 <a id="Ext.tree.TreeSorter-folderSort"></a>
\r
60 <b>folderSort</b> : Boolean <div class="mdesc">
\r
61 True to sort leaf nodes under non-leaf nodes (defaults to false) </div>
\r
63 <td class="msource">TreeSorter</td>
\r
65 <tr class="config-row alt">
\r
66 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
68 <a id="Ext.tree.TreeSorter-leafAttr"></a>
\r
69 <b>leafAttr</b> : String <div class="mdesc">
\r
70 The attribute used to determine leaf nodes when <a ext:cls="Ext.tree.TreeSorter" ext:member="folderSort" href="output/Ext.tree.TreeSorter.html#folderSort">folderSort</a> = true (defaults to "leaf") </div>
\r
72 <td class="msource">TreeSorter</td>
\r
74 <tr class="config-row expandable">
\r
75 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
77 <a id="Ext.tree.TreeSorter-property"></a>
\r
78 <b>property</b> : String <div class="mdesc">
\r
79 <div class="short">The named attribute on the node to sort by (defaults to "text"). Note that this property is only used if no sortType ...</div>
\r
81 The named attribute on the node to sort by (defaults to "text"). Note that this property is only used if no <a ext:cls="Ext.tree.TreeSorter" ext:member="sortType" href="output/Ext.tree.TreeSorter.html#sortType">sortType</a> function is specified, otherwise it is ignored. </div>
\r
84 <td class="msource">TreeSorter</td>
\r
86 <tr class="config-row alt expandable">
\r
87 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
89 <a id="Ext.tree.TreeSorter-sortType"></a>
\r
90 <b>sortType</b> : Function <div class="mdesc">
\r
91 <div class="short">A custom "casting" function used to convert node values before sorting. The function will be called with a single par...</div>
\r
93 A custom "casting" function used to convert node values before sorting. The function will be called with a single parameter (the <a ext:cls="Ext.tree.TreeNode" href="output/Ext.tree.TreeNode.html">Ext.tree.TreeNode</a> being evaluated) and is expected to return the node's sort value cast to the specific data type required for sorting. This could be used, for example, when a node's text (or other attribute) should be sorted as a date or numeric value. See the class description for example usage. Note that if a sortType is specified, any <a ext:cls="Ext.tree.TreeSorter" ext:member="property" href="output/Ext.tree.TreeSorter.html#property">property</a> config will be ignored. </div>
\r
96 <td class="msource">TreeSorter</td>
\r
99 <a id="Ext.tree.TreeSorter-props"></a>
100 <h2>Public Properties</h2>
101 <div class="no-members">This class has no public properties.</div> <a id="Ext.tree.TreeSorter-methods"></a>
102 <h2>Public Methods</h2>
103 <table cellspacing="0" class="member-table">
105 <th class="sig-header" colspan="2">Method</th>
106 <th class="msource-header">Defined By</th>
108 <tr class="method-row expandable">
\r
109 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
111 <a id="Ext.tree.TreeSorter-TreeSorter"></a>
\r
112 <b>TreeSorter</b>( <code>TreePanel tree</code>, <code>Object config</code> ) <div class="mdesc">
\r
113 <div class="short"></div>
\r
115 <div class="mdetail-params">
\r
116 <strong>Parameters:</strong>
\r
117 <ul><li><code>tree</code> : TreePanel<div class="sub-desc"></div></li><li><code>config</code> : Object<div class="sub-desc"></div></li> </ul>
\r
118 <strong>Returns:</strong>
\r
120 <li><code></code></li>
\r
126 <td class="msource">TreeSorter</td>
\r
129 <a id="Ext.tree.TreeSorter-events"></a>
130 <h2>Public Events</h2>
131 <div class="no-members">This class has no public events.</div>