mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-08 00:42:28 +02:00
Updated 3.1 Sort (markdown)
parent
310de63b8a
commit
565f6368d6
43
3.1-Sort.md
43
3.1-Sort.md
|
@ -25,24 +25,26 @@ where <code>tf</code> is an instance of <code>TableFilter</code>.
|
|||
<th>types</th>
|
||||
<td>array</td>
|
||||
<td>
|
||||
an array defining the column data types.
|
||||
Possible values:
|
||||
this array defines the data type on a column basis:
|
||||
<ul>
|
||||
<li>"String" (original parameter)</li>
|
||||
<li>"Number" (original parameter)</li>
|
||||
<li>"Date" (original parameter)</li>
|
||||
<li>"None" (original parameter)</li>
|
||||
<li>"us" (numeric format for US numbers)</li>
|
||||
<li>"eu" (numeric format for EU numbers)</li>
|
||||
<li>"dmydate" (DMY date format 05/08/2010)</li>
|
||||
<li>"mdydate" (MDY date format 08/05/2010)</li>
|
||||
<li>"ymddate" (YMD date format 2010/08/05)</li>
|
||||
<li>"ddmmmyyyydate" (DDMMMYYYY date format 05-Aug-2010)</li>
|
||||
<li>"ipaddress" (addtional TF parameter for IP addresses)</li>
|
||||
<li><code>string</code> (default column type if none specified)</li>
|
||||
<li><code>number</code> (unformatted number)</li>
|
||||
<li>
|
||||
<code>formatted-number</code> (defaults to '.' decimal separator and ',' thousands separator) or <br>
|
||||
or an object <code>{ type: 'formatted-number', decimal: ',', thousands: '.' }</code> for customisation
|
||||
</li>
|
||||
<li>
|
||||
<code>date</code> defaulting to <code>en</code> locale or <br>
|
||||
or an object <code>{ type: 'date', locale: 'en-GB', format: ['{dd}-{months}-{yyyy|yy}'] }</code> for
|
||||
customisation
|
||||
</li>
|
||||
<li><code>ipaddress</code> (specific to column sorting)</li>
|
||||
<li><code>caseinsensitivestring</code> (specific to column sorting)</li>
|
||||
<li><code>none</code> (specific to column sorting)</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
Note that there is a column data type resolution mechanism: if the <code>types</code> property is not defined the script will look for the <code>col_number_format</code> and <code>col_date_type</code> in order to resolve the column types. If there are no column types defined, the value will default to 'String'.
|
||||
Note that there is a column data type resolution mechanism: if the <code>types</code> property is not defined the script will look for the <code>col_types</code> option to resolve the column types. If there are no column types defined, the value will default to 'String'.
|
||||
|
||||
</td>
|
||||
<td><pre>
|
||||
|
@ -50,10 +52,15 @@ var tfConfig = {
|
|||
extensions: [{
|
||||
name: 'sort',
|
||||
types: [
|
||||
'None', 'String', 'Number',
|
||||
'eu', 'us', 'dmydate', 'mdydate',
|
||||
'ymddate', 'ddmmmyyyy', 'ipaddress'
|
||||
]
|
||||
'string',
|
||||
'number',
|
||||
'formatted-number', // defaults to '.' for decimal and ',' for thousands
|
||||
{ type: 'formatted-number', decimal: ',', thousands: '.' },
|
||||
'date',
|
||||
{ type: 'date', locale: 'fr' },
|
||||
{ type: 'date', locale: 'en', format: ['{dd}-{months}-{yyyy|yy}'] },
|
||||
'ipaddress'
|
||||
]
|
||||
}]
|
||||
};</pre>
|
||||
</td>
|
||||
|
|
Loading…
Reference in a new issue