dom-select.js 521 B

12345678910111213141516
  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. $.fn.dataTable.ext.order['dom-select'] = function ( settings, col )
  11. {
  12. return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
  13. return $('select', td).val();
  14. } );
  15. };