Unable to refresh the datatable cache -

Unable to refresh the datatable cache -

puneet.jayeepuneet.jayee Posts: 18Questions: 8Answers: 0
edited April 2018 in Free community support

I tried to use the invalidate function of the data table but unable to refresh the cache.
Scenario
I have a input text box in one of the column of the data table and when user input some value and click of export csv. The recently input value does not get exported. Please help!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945
    Answer ✓

    It would help if you could post a link to a page showing the issue. However I built this example previously and it may help you:
    http://live.datatables.net/zukacehi/1/edit

    Kevin

  • puneet.jayeepuneet.jayee Posts: 18Questions: 8Answers: 0

    Thanks a lot Kevin. Indeed that worked.
    Awesome....:) :)

  • puneet.jayeepuneet.jayee Posts: 18Questions: 8Answers: 0

    In a similar line - I would like to understand - How to update the data table cache, when we dynamically add or delete the row from the table.

    Do you have code snippet which shows - Datatable cache updated while we remove or add any row dynamically to the table?

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    Are you using the API (row.add(), row().remove())?

    If so then you probably just need to adddraw() to the line, take a look at the examples in the above links.

    If not using the API, you should if you can, then may row().invalidate() with the proper row selector for the new row. Probably will need to use rows().invalidate() to invalidate the table when deleting.

    Kevin

  • puneet.jayeepuneet.jayee Posts: 18Questions: 8Answers: 0

    Hello Kevin,

    Thanks. I tried to use the Row().Invalidate to refresh the data table cache but I was unable to do so. For your information - I am not using row.add or row.remove in my implementation.

    Do you have any code snippet or sample work which I can refer for updating the data table cache for dynamically adding and deleting the rows?

    Again for your information - I am not using row.add or row.remove in my implementation.

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    Please post an example of what you are doing and we can help.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

This discussion has been closed.