Dashboard sipadu mbip
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

order.neutral().js 987B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * This function will restore the order in which data was read into a DataTable
  3. * (for example from an HTML source). Although you can set `dt-api order()` to
  4. * be an empty array (`[]`) in order to prevent sorting during initialisation,
  5. * it can sometimes be useful to restore the original order after sorting has
  6. * already occurred - which is exactly what this function does.
  7. *
  8. * @name order.neutral()
  9. * @summary Change ordering of the table to its data load order
  10. * @author [Allan Jardine](http://datatables.net)
  11. * @requires DataTables 1.10+
  12. *
  13. * @returns {DataTables.Api} DataTables API instance
  14. *
  15. * @example
  16. * // Return table to the loaded data order
  17. * table.order.neutral().draw();
  18. */
  19. $.fn.dataTable.Api.register( 'order.neutral()', function () {
  20. return this.iterator( 'table', function ( s ) {
  21. s.aaSorting.length = 0;
  22. s.aiDisplay.sort( function (a,b) {
  23. return a-b;
  24. } );
  25. s.aiDisplayMaster.sort( function (a,b) {
  26. return a-b;
  27. } );
  28. } );
  29. } );