No matching records found

No matching records found

DakadoDakado Posts: 2Questions: 1Answers: 0

For some reason if I type anything in the search button, it always says "No matching records found". Data sorting is not working either.

My code:
https://jsfiddle.net/o2Lhe8wf/1/

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,174Questions: 26Answers: 4,923
    Answer ✓

    There are a few problems with your code. First you have two tbody tags. Datatables supports only one. For more info see the Datatable HTML requirements.

    Since you don't have a footer the column search event handler ($('input', this.footer()).on('keyup change clear', function() {) you have in initComplete is executing after the main search from your global search input. Basically there is one global search then 5, one for each column, column searches. This causes no matches.

    I commented out the second tbody, added a footer, added the code to generate the footer search inputs (from this example and commented out the invalid columnDefs. You only want one columnDefs option defined.

    Here is the updated test case:
    https://jsfiddle.net/5oy4twv1/

    Kevin

  • DakadoDakado Posts: 2Questions: 1Answers: 0

    Thanks worked.

This discussion has been closed.