Display length and sorting the table

Display length and sorting the table

mahesh3005mahesh3005 Posts: 3Questions: 0Answers: 0
edited February 2013 in Bug reports
Hi All,

Suppose the display length is selected as 10 records and if I click on any column to sort it , the data table is showing records > 10 , because I have selected 10 records to show , it should sort the data within the 10 records.

is there a setting for this in data table?

Replies

  • robertbrowerrobertbrower Posts: 158Questions: 1Answers: 0
    I think the sort is based on all rows, and not just the filtered rows. I am not sure how to change that. You could use a custom filter method:

    $.fn.dataTableExt.afnFiltering.push(function(oSettings, aData, iDataIndex) {

    // your custom code here should check if the iDataIndex is inside the range of filtered rows and if so, return true...

    });
This discussion has been closed.