Resort table using serverside date when Datepicker is clicked

Resort table using serverside date when Datepicker is clicked

brianfidlerbrianfidler Posts: 21Questions: 1Answers: 0
edited October 2010 in General
I'm using the jQuery Datepicker to pick a date field that filters one of my columns of data. Right now, when I click the date, it populates the field but doesn't actually force the table to resort. How can I get my table to resort when I choose the date?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you are using server-side processing, then all you need to do is call the fnDraw API function (that will cause DataTables to go tot he server and get updated data). But that presumes that you have updated the database with the information selected from the date picker?

    Allan
  • brianfidlerbrianfidler Posts: 21Questions: 1Answers: 0
    I am using fnDraw but it doesn't refresh until I tab into the field. Is there a way to force refresh when I click on the date?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yes, you'd need to put a click event handlers on the date input and call fnDraw with it. The date picker might have events already available for this which you can hook into.

    Allan
This discussion has been closed.