how do i wait for the new ajax data from the server before calling the function to generate dropdown

how do i wait for the new ajax data from the server before calling the function to generate dropdown

gwiqugwiqu Posts: 8Questions: 4Answers: 1

im following the code similar to this to implement the column filtering to be dynamic but with select2
http://live.datatables.net/cusologu/7/edit
but for some reason when the columns gets refreshed, the data is using the previous search data

how do i wait for the new search results to come back before calling the createDropdown(api) function?

This question has an accepted answers - jump to answer

Answers

  • gwiqugwiqu Posts: 8Questions: 4Answers: 1
    Answer ✓

    alright i figured it out

    do not call
    createDropdowns(api);

    in the on change function but change the
    initComplete: function()

    to drawCallback: function()

  • allanallan Posts: 56,837Questions: 1Answers: 9,033 Site admin

    Thanks for posting back - yes that sounds good to me.

    Allan

Sign In or Register to comment.