Problems applying noVis to columns with rowspan colspan
Problems applying noVis to columns with rowspan colspan
Link to test case: https://live.datatables.net/kojunuce/10/edit
Debugger code (debug.datatables.net): No Error.
Error messages shown: No Error
Description of problem: I'm having problems getting noVis to work when the columns involved have rowspan and colspan enabled. I'm attaching two test cases, one in which it works perfectly and hides the column if it's an employee and prevents it from showing in "Column Visibility". If it's false, it should display correctly.
In the test case: https://live.datatables.net/kojunuce/10/edit is the described situation, and below I show a case where I don't have colspan and rowspan and it works perfectly: https://live.datatables.net/kojunuce/4/edit
If you have a chance to take a look and provide me with suggestions, I would really appreciate it. Thank you in advance.
I don't know if I explained myself well, in the case described: https://live.datatables.net/kojunuce/10/edit The Salary column should not appear when I click on Column Visibility
This question has an accepted answers - jump to answer
Answers
I think it works if you just use
layout
: https://live.datatables.net/kojunuce/11/edit . Is that what you were looking for?The issue with your test case was that you had both
dom
andlayout
being used, but they are mutually exclusive - you can't use both at the same time.Allan
Hello, good morning, thank you for taking the time to respond to my message. Regarding me combining 'dom' with 'layout', I took an example that was similar to what I was looking for, I have already migrated my installation but that is not the problem. The issue is that if you review the two cases I have provided, they behave differently. The goal is that if it is an 'employee' viewing the table, the salary column should not be visible and it should also disappear from "Column visibility" for which I am using 'noVis'. But if you observe the case that you have kindly updated, you will notice that if 'Employee = true', the column should not be visible, which it does correctly, but 'noVis' no longer works and still shows the column. I noticed this behavior happens when the column in question belongs to a colspan group. In my message, I provided another example where I do not have colspan and noVis works fine. Both examples I provided have the same logic, but they do not behave the same because of colspan.
I'm with you now - thanks for the clarification. The issue is that the column does have a cell which matches
:not(.noVis)
- the cell which is row span'ing!I think you might need to specify column indexes to get the columns you want at the moment. I need to have a bit more of a think about how to correctly handle a situation such as this.
Allan
Thank you very much, I continue to be attentive to any comments. Best regards
I am following up as I noticed that the issue reported in this ticket remains unresolved.
Best regards
https://live.datatables.net/kojunuce/23/edit
You need to add
noVis
to the colspan'ing element if you don't want it to be considered for selection with that selector.https://live.datatables.net/kojunuce/24/edit
Allan
I am very grateful, Allan. It has been a while, but now the answer is clear. Thank you very much.