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