Table still keeping the first searched result, paging information not updated neither!

Table still keeping the first searched result, paging information not updated neither!

jeggjegg Posts: 3Questions: 1Answers: 0

Hi,
I have a problem with using $(table).DaTable() thanks very much in advance for your help!

when I do the search for the first time, there is no problem, I get the table and the paging information is all correct, like the total result, the number of pages, etc.

But......when I search again using different searching criteria, the paging information is not updated and still keeps the information of the previous search. When I click on the sort on any of the columns, the table refreshes and also go back to the result of the previous search.

Can somebody tell me what is going on?

when click on sort on the column it goes back to the first search result

It looks like the table is still keeping the old state not updated correctly, I tried $("#tableID").DaTable() .ajax.refresh(), not working :neutral:

thanks again for your kind help!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 20,145Questions: 26Answers: 4,736
    Answer ✓

    when I search again using different searching criteria, the paging information is not updated and still keeps the information of the previous search.

    I'm guessing this is outside of Datatables and you are directly updating the DOM with the new results. If this is correct then see this FAQ.

    Please provide more details of how this process works. Or better post a link to your page or a running test case replicating the issue so we can see what is happening.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • jeggjegg Posts: 3Questions: 1Answers: 0

    thank you so muich Kevin!

  • jeggjegg Posts: 3Questions: 1Answers: 0

    thanks very much for the remiding Colin

Sign In or Register to comment.