1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="option">
<name>order</name>
<summary>Initial order (sort) to apply to the table</summary>
<since>1.10</since>
<type type="array" />
<default value="[[0, 'asc']]" />
<description>
If ordering is enabled (`dt-init ordering`), then DataTables will perform a first pass order during initialisation. Using this parameter you can define which column(s) the order is performed upon, and the ordering direction. The `dt-init order` must be an array of arrays, each inner array comprised of two elements:
* Column index to order upon
* Direction so order to apply (`-string asc` for ascending order or `-string desc` for descending order).
This 2D array structure allows a multi-column order to be defined as the initial state should it be required.
</description>
<example title="No ordering applied by DataTables during initialisation. The rows are shown in the order they are read by DataTables (i.e. the original order from the DOM if DOM sourced, or the array of data if Ajax / data sourced)"><![CDATA[
$('#example').dataTable( {
"order": []
} );
]]></example>
<example title="Multi-column ordering as the initial state"><![CDATA[
$('#example').dataTable( {
"order": [[ 0, 'asc' ], [ 1, 'asc' ]]
} );
]]></example>
<related type="option">ordering</related>
<related type="option">orderFixed</related>
<related type="option">columns.orderable</related>
<related type="option">columns.orderData</related>
<related type="option">columns.orderSequence</related>
<related type="api">order()</related>
</dt-option>
|