1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-08 00:42:28 +02:00

Updated 3.1 Sort (markdown)

koalyptus 2016-10-09 14:17:11 +11:00
parent 310de63b8a
commit 565f6368d6

@ -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>&quot;String&quot; (original parameter)</li>
<li>&quot;Number&quot; (original parameter)</li>
<li>&quot;Date&quot; (original parameter)</li>
<li>&quot;None&quot; (original parameter)</li>
<li>&quot;us&quot; (numeric format for US numbers)</li>
<li>&quot;eu&quot; (numeric format for EU numbers)</li>
<li>&quot;dmydate&quot; (DMY date format 05/08/2010)</li>
<li>&quot;mdydate&quot; (MDY date format 08/05/2010)</li>
<li>&quot;ymddate&quot; (YMD date format 2010/08/05)</li>
<li>&quot;ddmmmyyyydate&quot; (DDMMMYYYY date format 05-Aug-2010)</li>
<li>&quot;ipaddress&quot; (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>