Edit Show / hide columns dynamically In API
Edit Show / hide columns dynamically In API
menssouri83
Posts: 5Questions: 1Answers: 0
Hello ,
in the Show / hide columns dynamically page :
http://datatables.net/examples/api/show_hide.html
http://s23.postimg.org/gtuit6orv/image.png
We want to change the text lien select columns to checkbox option like in this exemple
http://s28.postimg.org/toyqtzq6l/image.png
When the checkbox are selected and checked the comumns are visible if the checkbox are not selected and are unchecked the columns are unvisible
Can same one help me please !
This discussion has been closed.
Answers
So just create the checkboxes, either hardcode them or use the
columns()
to get the columns, then JS/jQuery to draw them up.Give the checkboxes an attribute like
data-column
with either the column index #, or the column name (set bycolumns.name
). Then with jQuery, create a.click()
event watcher for the checkboxes, to check if it was just checked or unchecked, then use thecolumn().visible()
functionality to hide/show the column.Another option, would be to use the Column Visibility Button, which is what I prefer.
Did you just need help on how to do it? Or were you looking for someone to basically do it for you?
I'm not an expert in code , can you give me an exemple or if you can do it to me it well be very great .
Toggle column:
</a> - <a class="toggle-vis" data-column="0">Name</a> - <a class="toggle-vis" data-column="1">Network</a> - <a class="toggle-vis" data-column="2">Advertiser</a> - <a class="toggle-vis" data-column="3">Status</a> - <a class="toggle-vis" data-column=
"4">Preview</a>
I usually find if I just do the code for someone, they usually come back for a glass of milk, apologies
If you need someone to do it for you, and since its a small enough task, maybe you can purchase some support from @allan, and he can knock it out. But thats up to him, obviously.
many thanks
Any one can help me to do it without purchase any payed support !
If you arent a web developer, and dont have any desire to learn how to code, then youre going to have to hire a developer sooner or later..
If you do want tl learn js, this task is simple enough with just a few lines of jquery and the datatables api
Alternatively, I would suggest just using the
columnsVisibility
orcolumnsToggle
orcolvis
Yes, this forum will not actively develop new software specific to your project for you. We can help with specific DataTables questions if you link to a page showing what you have got already, but creating individual projects is not a service I offer.
Allan