redraw table without ajax call and using local array

redraw table without ajax call and using local array

pmengopmengo Posts: 74Questions: 37Answers: 2
edited April 2016 in DataTables 1.10

I am using server side processing and when i do myTableName.tbl.clear().draw(false) ajax is fired again.
How can i prevent ajax call on draw()?
myTableName.editor.on('submitComplete', function (e, data, action) {
var tbdata=myTableName.tbl.data();
debugger;
console.log(this.s.action)
if(this.s.action=='edit'){
}
if(this.s.action=='create'){
tbdata.push(data);
}
myTableName.tbl.clear().draw(false);
myTableName.tbl.rows.add(tbdata);

i know that this cant be done with server side processing. At least can i send a paramenter to server to return nothing and clear table? Can i do this with a search that returns nothing?

Which is the best way in your opinion?

http://www.quad-systems.pt/QUAD_HCM/#ajax/datatablePROTODocs.php

debug code : ipehan

Answers

  • allanallan Posts: 61,824Questions: 1Answers: 10,130 Site admin

    How can i prevent ajax call on draw()?

    If you are using server-side processing you can't. There is no option to not have DataTables make a request to the server on draw in SSP mode - that's the whole point of server-side processing after all.

    Allan

This discussion has been closed.