| 4 |
lars |
1 |
/**
|
|
|
2 |
* Read information from a column of input (type text) elements and return an
|
|
|
3 |
* array to use as a basis for sorting.
|
|
|
4 |
*
|
|
|
5 |
* @summary Sorting based on the values of `dt-tag input` elements in a column.
|
|
|
6 |
* @name Input element data source
|
|
|
7 |
* @requires DataTables 1.10+
|
|
|
8 |
* @author [Allan Jardine](http://sprymedia.co.uk)
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
$.fn.dataTable.ext.order['dom-text'] = function ( settings, col )
|
|
|
12 |
{
|
|
|
13 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
14 |
return $('input', td).val();
|
|
|
15 |
} );
|
|
|
16 |
};
|