How initialize custom header row
How initialize custom header row
tapacko
Posts: 4Questions: 1Answers: 0
Hello. I am creating a table dynamically (columns and column data types are variable).
I cloned the header row and added custom filters to columns.
It works, but for now, I need to change columns visibility, and my custom row is always visible.
Is it any way to make a custom row connected to table API?
Thanks.
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
I created a simple example:
live.datatables.net/ligesada/1/
Click on CHANGE VISIBILITY button
Thanks.
It's because you're modifying the HTML in
initComplete
, so DataTables has no knowledge of it. Try adding theinput
elements in thecreatedRow
instead, that should do the trick.If you're editing within the rows, it would be worth looking at the Editor inline editing example.
Colin
Thanks, Colin,
but unfortunately it doesn't help.
I moved HTML manipulation in createdRow:
http://live.datatables.net/ligesada/2/edit?html,js,output
Thanks.
I made some tricks with header creation and later moved the filter row under the title row and it works in this way.
http://live.datatables.net/ligesada/3/edit?html,js,output
Please close the question. Thanks.
Glad all sorted,
Colin