Re-draw the table when user uses new searchfunction.

Re-draw the table when user uses new searchfunction.

rielriel Posts: 1Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
I have made a function like this.

data is a format [["1","2","3","4"],["1","2","3","4"]] string which is parsed as data, works fine.
all is just a number I use later on.

The function insertReply(data,all) and is called trough JSONP, a Google Apps script generates the JSONP data. This all works fine, when I press the search button a search command is sent to the GAS, and it returns the JSONP function and array.

But when I press the serach button the second time, I get new data returned, but the table isn't updating. I log my data, and it is another array, but the table just keeps having the same rows.

Any ideas?

function insertReply(data,all) {


$(document).ready( function () {

$('#example').dataTable( {
"aaSorting": [],
"bLengthChange": false,
"iDisplayLength": 5,
"bPaginate": true,
"aaData": JSON.parse(data),
"bRetrieve": true,
"aoColumns": [
{ "sTitle": "Matching" },
{ "sTitle": "Sectorervaring" },
{ "sTitle": "Beschikbaarheid" },
{ "sTitle": "Selecteer" }

]
} );
} );
This discussion has been closed.