.filter() is not working or something else need to add.

.filter() is not working or something else need to add.

kishorpawarkishorpawar Posts: 3Questions: 1Answers: 0
edited March 2016 in Free community support

I am following .filter() example

This is live example

The example seems not working.

Have I missed something? or What more needs to be done?

Thanks.

Answers

  • allanallan Posts: 63,771Questions: 1Answers: 10,510 Site admin

    At the top of the documentation page you linked to, it notes:

    This method should not be confused with search() which is used to search for records in the DataTable - i.e. the filter method does not change the rows that are displayed in the DataTable.

    You cannot use filter() to effect the display of the table. If you want to use a custom function to search the table you need to use a custom search plug-in.

    Allan

  • kishorpawarkishorpawar Posts: 3Questions: 1Answers: 0

    Hey Allan,

    Thanks for your reply, and sorry for misinterpretation.

    Though I used following to get it worked.

    var table = $('#example').dataTable();
    
    table.fnFilter("London", 2, true);
    
This discussion has been closed.