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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="option">
<name>orderFixed</name>
<summary>Ordering to always be applied to the table</summary>
<since>1.10</since>
<type type="array">
<description>
Prefix ordering.
When given as an array, the ordering specified by `dt-init orderFixed` will be applied as a prefix order. The format of the array is described above.
</description>
</type>
<type type="object">
<description>
Prefix and / or postfix ordering.
When given as an object, the `pre` and / or `post` parameters can be used to specify prefix and / or postfix ordering, respectively. neither option is required, so you can specify the option that you need only.
As with the simple array option, the format of the arrays used described above.
</description>
</type>
<description>
The option works in tandem with the `dt-init order` option which provides an initial ordering state for the table which can then be modified by the user clicking on column headings, while the ordering specified by this option will always be applied to the table, regardless of user interaction.
This fixed ordering can be applied before (`pre`) or after (`post`) the user's own ordering criteria using the two different forms of this option (array or object) described below.
The values that are used to describe the ordering conditions for the table are given as two element arrays:
* Column index to order upon
* Direction so order to apply (`-string asc` for ascending order or `-string desc` for descending order).
It is also possible to give a set of nested arrays (i.e. arrays in arrays) to allow multi-column ordering to be assigned.
This option can be useful if you a column (visible or hidden) which must always be sorted upon first - a priority order or index column for example, or for grouping similar rows together.
</description>
<example title="The first column will always be sorted upon first"><![CDATA[
$('#example').dataTable( {
"orderFixed": [ 0, 'asc' ]
} );
]]></example>
<example title="As above, the first colum is fixed ordering, but in object form"><![CDATA[
$('#example').dataTable( {
"orderFixed": {
"pre": [ 0, 'asc' ]
}
} );
]]></example>
<example title="The first and second column will always be ordered upon last (postfix) - note how a 2D array is used to specify multiple columns for postfix ordering."><![CDATA[
$('#example').dataTable( {
"orderFixed": {
"post": [[ 0, 'asc' ], [ 1, 'asc' ]]
}
} );
]]></example>
<example title="Both postfix and prefix options specified"><![CDATA[
$('#example').dataTable( {
"orderFixed": {
"pre": [ 0, 'asc' ],
"post": [ 1, 'asc' ]
}
} );
]]></example>
<related type="option">ordering</related>
<related type="option">order</related>
<related type="option">columns.orderable</related>
<related type="option">columns.orderData</related>
<related type="api">order()</related>
<related type="api">order.fixed()</related>
</dt-option>
|