Is it possible to hide a column in the datatable used for the editor?
I have tried using in the .JS file:
"columnDefs": [ { "targets": [ 0 ], "visible": false, "searchable": false } ],
But it doesn't work.
This question has an accepted answers - jump to answer
I believe you are looking for something like this...
fields: [ { label: "RecordID:", name: "time.recordID", type: "hidden" },
The columnDefs are what you see in the actual HTML table, not what you put in the editor.
Actually, I want to have the user id in the main HTML table to pass to a Modal window but not show as a column in the main HTML table.
The columns.visible option should work. If it isn't, then my guess (only guessing without a test case :-) ) is that you are using Responsive. If that is the case assign the class never to that column.
columns.visible
never
Allan
Thanks Allan, I have table as responsive. How so I assign a class to that column?
Nevermind...I got it, thanks
For anyone else - columns.className.
columns.className
{ className: "never", "targets": [ 0 ] }
It looks like you're new here. If you want to get involved, click one of these buttons!
Answers
I believe you are looking for something like this...
The columnDefs are what you see in the actual HTML table, not what you put in the editor.
Actually, I want to have the user id in the main HTML table to pass to a Modal window but not show as a column in the main HTML table.
The
columns.visible
option should work. If it isn't, then my guess (only guessing without a test case :-) ) is that you are using Responsive. If that is the case assign the classnever
to that column.Allan
Thanks Allan, I have table as responsive. How so I assign a class to that column?
Nevermind...I got it, thanks
For anyone else -
columns.className
.Allan