Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.util.Sortable.html
diff --git a/docs/api/Ext.util.Sortable.html b/docs/api/Ext.util.Sortable.html
new file mode 100644 (file)
index 0000000..f2af813
--- /dev/null
@@ -0,0 +1,112 @@
+<!DOCTYPE html><html><head><title>Ext.util.Sortable | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
+<style type="text/css">.head-band { display: none; }
+.header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
+.doc-tab .members .member a.more { background-color: #efefef; }
+</style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
+</head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
+<a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
+
+    req = {
+        liveURL: '.',
+        standAloneMode: true,
+        origDocClass: 'Ext.util.Sortable',
+        docClass: 'Ext.util.Sortable',
+        docReq: 'Ext.util.Sortable',
+        version: '4.0',
+        baseURL: '.',
+        baseDocURL: '.',
+        baseProdURL: '.'
+    };
+
+    clsInfo = {};
+
+
+
+</script>
+
+<script type="text/javascript" src="../search.js"></script>
+<!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
+<script type="text/javascript" src="../class_tree.js"></script>
+<script type="text/javascript" src="../class_doc.js"></script>
+<script type="text/javascript">
+    req.source = 'Sortable.html#Ext-util.Sortable';
+    clsInfo = {"methods":["getSortState","initSortable","sort"],"cfgs":[],"properties":["defaultSortDirection","isSortable","sortRoot","sorters"],"events":[],"subclasses":[]};
+    Ext.onReady(function() {
+        Ext.create('Docs.classPanel');
+    });
+</script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/Sortable.html#Ext-util.Sortable" target="_blank">Ext.util.Sortable</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>A mixin which allows a data component to be sorted. This is used by e.g. <a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Ext.data.Store</a> and <a href="Ext.data.TreeStore.html" rel="Ext.data.TreeStore" class="docClass">Ext.data.TreeStore</a>.</p>
+
+<p>*NOTE**: This mixin is mainly for internal library use and most users should not need to use it directly. It
+is more likely you will want to use one of the component classes that import this mixin, such as
+<a href="Ext.data.Store.html" rel="Ext.data.Store" class="docClass">Ext.data.Store</a> or <a href="Ext.data.TreeStore.html" rel="Ext.data.TreeStore" class="docClass">Ext.data.TreeStore</a>.</p>
+<div class="members"><div class="m-properties"><a name="properties"></a><div class="definedBy">Defined By</div><h3 class="prp p">Properties</h3><div id="property-defaultSortDirection" class="member f ni"><a href="Ext.util.Sortable.html#property-defaultSortDirection" rel="property-defaultSortDirection" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-property-defaultSortDirection" class="viewSource">view source</a></div><a name="defaultSortDirection"></a><a name="property-defaultSortDirection"></a><a href="Ext.util.Sortable.html#" rel="property-defaultSortDirection" class="cls expand">defaultSortDirection</a><span> : String</span></div><div class="description"><div class="short"><p>The default sort direction to use if one is not specified (defaults to "ASC")</p>
+</div><div class="long"><p>The default sort direction to use if one is not specified (defaults to "ASC")</p>
+</div></div></div><div id="property-isSortable" class="member ni"><a href="Ext.util.Sortable.html#property-isSortable" rel="property-isSortable" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-property-isSortable" class="viewSource">view source</a></div><a name="isSortable"></a><a name="property-isSortable"></a><a href="Ext.util.Sortable.html#" rel="property-isSortable" class="cls expand">isSortable</a><span> : Boolean</span></div><div class="description"><div class="short"><p>Flag denoting that this object is sortable. Always true.</p>
+</div><div class="long"><p>Flag denoting that this object is sortable. Always true.</p>
+</div></div></div><div id="property-sortRoot" class="member ni"><a href="Ext.util.Sortable.html#property-sortRoot" rel="property-sortRoot" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-property-sortRoot" class="viewSource">view source</a></div><a name="sortRoot"></a><a name="property-sortRoot"></a><a href="Ext.util.Sortable.html#" rel="property-sortRoot" class="cls expand">sortRoot</a><span> : String</span></div><div class="description"><div class="short"><p>The property in each item that contains the data to sort. (defaults to null)</p>
+</div><div class="long"><p>The property in each item that contains the data to sort. (defaults to null)</p>
+</div></div></div><div id="property-sorters" class="member ni"><a href="Ext.util.Sortable.html#property-sorters" rel="property-sorters" class="expand more"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-property-sorters" class="viewSource">view source</a></div><a name="sorters"></a><a name="property-sorters"></a><a href="Ext.util.Sortable.html#" rel="property-sorters" class="cls expand">sorters</a><span> : Ext.util.MixedCollection</span></div><div class="description"><div class="short"><p>The collection of <a href="Ext.util.Sorter.html" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p>
+</div><div class="long"><p>The collection of <a href="Ext.util.Sorter.html" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p>
+</div></div></div></div><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-getSortState" class="member f ni"><a href="Ext.util.Sortable.html#method-getSortState" rel="method-getSortState" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-method-getSortState" class="viewSource">view source</a></div><a name="getSortState"></a><a name="method-getSortState"></a><a href="Ext.util.Sortable.html#" rel="method-getSortState" class="cls expand">getSortState</a> : Object</div><div class="description"><div class="short"><p>Returns an object describing the current sort state of this Store.</p>
+</div><div class="long"><p>Returns an object describing the current sort state of this Store.</p>
+<h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>The sort state of the Store. An object with two properties:<ul>
+<li><b>field</b> : String<p class="sub-desc">The name of the field by which the Records are sorted.</p></li>
+<li><b>direction</b> : String<p class="sub-desc">The sort order, 'ASC' or 'DESC' (case-sensitive).</p></li>
+</ul>
+See <tt><a href="Ext.util.Sortable.html#sortInfo" rel="Ext.util.Sortable#sortInfo" class="docClass">sortInfo</a></tt> for additional details.</p>
+</li></ul></div></div></div><div id="method-initSortable" class="member ni"><a href="Ext.util.Sortable.html#method-initSortable" rel="method-initSortable" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-method-initSortable" class="viewSource">view source</a></div><a name="initSortable"></a><a name="method-initSortable"></a><a href="Ext.util.Sortable.html#" rel="method-initSortable" class="cls expand">initSortable</a> : void</div><div class="description"><div class="short">Performs initialization of this mixin. Component classes using this mixin should call this method
+during their own in...</div><div class="long"><p>Performs initialization of this mixin. Component classes using this mixin should call this method
+during their own initialization.</p>
+<h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
+</li></ul></div></div></div><div id="method-sort" class="member ni"><a href="Ext.util.Sortable.html#method-sort" rel="method-sort" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.Sortable.html" class="definedIn docClass">Ext.util.Sortable</a><br/><a href="../source/Sortable.html#Ext-util.Sortable-method-sort" class="viewSource">view source</a></div><a name="sort"></a><a name="method-sort"></a><a href="Ext.util.Sortable.html#" rel="method-sort" class="cls expand">sort</a>(
+<span class="pre">String|Array sorters, String direction, Object where, Object doSort</span>)
+ : void</div><div class="description"><div class="short">Sorts the data in the Store by one or more of its properties. Example usage:
+
+
+//sort by a single field
+myStore.sort(...</div><div class="long"><p>Sorts the data in the Store by one or more of its properties. Example usage:</p>
+
+
+<pre><code>//sort by a single field
+myStore.sort('myField', 'DESC');
+
+//sorting by multiple fields
+myStore.sort([
+    {
+        property : 'age',
+        direction: 'ASC'
+    },
+    {
+        property : 'name',
+        direction: 'DESC'
+    }
+]);
+</code></pre>
+
+
+<p>Internally, Store converts the passed arguments into an array of <a href="Ext.util.Sorter.html" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual
+sorting to its internal <a href="Ext.util.MixedCollection.html" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p>
+
+
+<p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p>
+
+
+<pre><code>store.sort('myField');
+store.sort('myField');
+     </code></pre>
+
+
+<p>Is equivalent to this code, because Store handles the toggling automatically:</p>
+
+
+<pre><code>store.sort('myField', 'ASC');
+store.sort('myField', 'DESC');
+</code></pre>
+
+<h3 class="pa">Parameters</h3><ul><li><span class="pre">sorters</span> : String|Array<div class="sub-desc"><p>Either a string name of one of the fields in this Store's configured <a href="Ext.data.Model.html" rel="Ext.data.Model" class="docClass">Model</a>,
+or an Array of sorter configurations.</p>
+</div></li><li><span class="pre">direction</span> : String<div class="sub-desc"><p>The overall direction to sort the data by. Defaults to "ASC".</p>
+</div></li><li><span class="pre">where</span> : Object<div class="sub-desc">
+</div></li><li><span class="pre">doSort</span> : Object<div class="sub-desc">
+</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
+</li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>
\ No newline at end of file