data-visible not honored when updating existing rows
data-visible not honored when updating existing rows
cezar
Posts: 3Questions: 1Answers: 0
If you update an existing row using var row = $(whatever).find('td'); row.text('newtext); DataTables completely ignores data-visible="false" in <thead>. Has anyone come up with a workaround for this bug?
This discussion has been closed.
Replies
Not sure I understand your problem description. You aren't using Datatables API's to updated the table.
Please provide more details of what you mean. How is it ignored?
Kevin
Yup - I'm not quite clear on what is happening either. You can use
columns.visible
to set the column visibility, and that can be set as a data attribute at initialisation time, but DataTables will not react to changed in the data attributes after initialisation. Use the API instead.Allan
I'm not changing the attributes after initialization. I'm setting them once in the markup and then updating rows through the API
That sounds like it should work. If it isn't doing what you expected, I'd be happy to take a look at a test case showing the issue.
Allan
Maybe you have saved setting in localstorage (if statesave is on) which overrides the visibility setting.