dom-text.js 523 B

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