Problems applying noVis to columns with rowspan colspan

Problems applying noVis to columns with rowspan colspan

samot80samot80 Posts: 4Questions: 2Answers: 0
edited May 15 in Free community support

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

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    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 and layout being used, but they are mutually exclusive - you can't use both at the same time.

    Allan

  • samot80samot80 Posts: 4Questions: 2Answers: 0

    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.

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    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

Sign In or Register to comment.