Question about ID and VAR for multiple tables with Yadcf
Question about ID and VAR for multiple tables with Yadcf
I have a page with several datatables tables
I'm using the same var for each, only the ID is different.
var table = $('#list1').DataTable();
var table = $('#list2').DataTable();
First is it good to do that or I should use different var for each table?
If there are no problem to use the same var, how can I init Yadcf the the ID instead of the var?
Now I'm using
yadcf.init(table, [],);
and I'd like to init using ID instead of the var
could you provide the good syntax if possible
Thanks
This question has an accepted answers - jump to answer
Answers
Hi,
You have to provide the DT object for yadcf,
You can init yadcf like this:
yadcf.init($('#list1').DataTable(), []);
Hi,
I have removed the var table = and use your syntax
This seems to work ok for now except for filter reset because table does not exist anymore...
$("#filter_reset").click(function() {
yadcf.exResetAllFilters(table);
});
Is there a way to still use var table = with the syntax you proposed
just in case it's break somethings with datatables or it's plugins?
Or should I stick with my previous with var= and give a different var to each table?
Give a different var to each...
Ok thanks
```