jquery - Datatables colVis use column name instead of index -


I'm using datatable 1.10 with the colavis extension.

Instead of: ":" "exclusion": [17], "buttontext": "column"}

I use the new datatable API I would like to do something like this:

  "clovis": {"exclude": [oTable.column ('priority: name'). Index ()], "button text": "column"}  

priority is the name of the column I want to hide.

How does anyone know how to do this?

After you start the table, you can solve this by adding the colVis to something like this ...

  & lt; Script & gt; $ (Document) .ready (function () {var table = $ ('# example'). Datatale (); var colvis = new $ .fn.dataTable.ColVis (table, {exclude: [table.column ('priority : Name '). Index ()], button text: "column"}); $ (colwitz.button). InsertAfter ('. SomeDiv ');}); & Lt; / Script & gt;  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -