Get table id on which ColVis is activated
Get table id on which ColVis is activated
MaiorovYury
Posts: 4Questions: 0Answers: 0
Hi, everyone
I have a question. Basically, I am using ColVis with fnFilter. And when I hide a column, I want to cancel this filter.
I was able to change _fnDomColumnButton function inside ColVis.js file to do that.
But now I faced an issue, when I have 2 or more tables on a page - how do I know which table this function relates to? So basically, how inside this function I can get id of a table on which it runs?
I have a question. Basically, I am using ColVis with fnFilter. And when I hide a column, I want to cancel this filter.
I was able to change _fnDomColumnButton function inside ColVis.js file to do that.
But now I faced an issue, when I have 2 or more tables on a page - how do I know which table this function relates to? So basically, how inside this function I can get id of a table on which it runs?
This discussion has been closed.
Replies
Otherwise if you are having ColVis you should be able to use `settings.nTable.id` where `settings` is the DataTables settings object.
Allan
thank you very much!
Not knowing that I had to add another parameter to ColVis initialization. But this way is much better!