Can you use colvis with datatable editor?
Can you use colvis with datatable editor?
the_mace
Posts: 10Questions: 3Answers: 0
So in my case columns that are editable are selected like this:
$('#test_data').on( 'click', 'tbody td:not(:first-child, ' +
':nth-child(1), ' +
':nth-child(2),' +
':nth-child(4),' +
':nth-child(14)' +
')', function (e) {
editor.inline( table.cell( this ).index(), { onBlur: 'submit' });
When columns are hidden by colvis all the column numbers shift so whats clickable for editing changes. Right now colvis breaks the functionality so the editor only works correctly when all columns are shown.
Is there some way to make them both work better together?
This question has accepted answers - jump to:
Answers
Try adding a classname, using
columns.className
to the columns you want to inline edit. Change the selector by removing the:not()
and just use the classname.Kevin
There is an example of what Kevin suggested available here.
Allan
Thanks folks, I knew I was missing something obvious here. Appreciate the quick and thorough help!