Run method after filter

Run method after filter

miguelaupmiguelaup Posts: 3Questions: 2Answers: 1

I load the table with ajax calling a webservice. This webservice return only the first X values (not all of them) but i need the entire data to load some graphs.
The data is stored in a json property (searchedData). This data is loaded when the page is loaded but i need to call this method again when some filter is applied on the table.

How can i run a method after filter?

This is the code:

var table = $('#status').DataTable({
processing: true,
serverSide: true,
ajax: {
url: "../../../GetEmployees",
type: "POST"
},
initComplete: function (settings, json) {
jsonArr = json.searchedData;
LoadGraphs(jsonArr);
}

        });

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    If you are having to send all of the data back to figure out your graphing, why do you have serverSide set to true? You are not gaining anything.

  • allanallan Posts: 63,892Questions: 1Answers: 10,530 Site admin

    Agreed. If you want the full data set, then you don't want to use server-side processing. The explicitly means that you wouldn't have the full data set!

    Allan

  • miguelaupmiguelaup Posts: 3Questions: 2Answers: 1
    Answer ✓

    The problem is that i have around 32k rows so the time to load the grid is very huge. I have solved the problem callig reload function.

This discussion has been closed.