How to remove fixed column after initializing in jquery?
How to remove fixed column after initializing in jquery?
Aravindkumar
Posts: 5Questions: 2Answers: 0
Am using fixed column in datatable, after ajax completed am initializing datatable, but on button click I need to remove fixed column from data table. I have tried many methods but no use. If any suggestion plz tell. Advance thanks..
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
As was answered by dykstrad above to change the number of columns fixed you can use iLeftColumns setting, like this:
However removing fixed columns is impossible with this method, for that you need to hide the overlay plugin produces or destroy the instance all together, I've decided to destroy it, so I've extended the plugin with this:
With this method on board removing and reapplying is simple:
and then from the very beginning:
I also tried it's working fine for me
http://stackoverflow.com/questions/23700623/jquery-datatables-fixedcolumns-remove-fixed-columns-dynamically
You can alter the visibility of the fixed columns, but currently there is no way to dynamically add and removed columns from the fixed part. You need to destroy the table and then recreate it as @heartdisk suggests.
It might be possible in a future update to do it dynamically, but it isn't something I'm prioritizing development of at the moment I'm afraid.
Allan
Thanks allan and Heartdisk..
Hello Allan, One more Doubt. Is there any possible to expand data table from normal div to whole page (For example: youtube video expanding.)? Is that possible in data table?
It isn't something that is built into DataTables, but there is no reason why you shouldn't be able to change the position and size of an element that contains a DataTable.
Allan