Hello, I need some help to hide some columns in the column picker. Here's the current situation of the app:
- In one screen, I am using 4 different datagrid with different information embedded to them
- Each datagrid have hidden columns that are needed such as Identifiers when I click the cell using an action column
- Those columns that are hidden should not be seen in the column picker at all, so I use a css to hide them. It's working but other datagrid's column picker is affected.
- For example, .column-picker > .wj-listbox-item:last-child{ display: none;} In effect, all last child in all datagrid is hidden.
I tried putting the name of the container in which they are located but when I check on the console it doesn't read the container in the class. Note that I cannot split them into 4 screens. Is there a js to hide them to be use in the initialize? Thank you.
Hi @Matanong
Could you please explain in more detail the exact use case you want to achieve?The requirements are a bit confusing and the code in the oml isn't clear since you have no toggle to show/hide the columns sample id and MainId and you're setting ShowHiddenColumns = true in the client action SetColumnVisibility, so they will always be visible. Also, if you look carefully at the client action SetColumnVisibility, you need to have Visible = False and CanBeHidden = False which is not the case.
Using the client action and adding a toggle I was able to achieve what was my understanding of your requirements:
Cols Hidden:
Cols Visible:
Cheers,GM
Hello @Matanong
Have you tried to use the SetColumnVisibility client action?That seems to be a perfect use case for using it.Other than that, you should always provide a sample oml to share the use case you're trying to solve so it can be more efficient and less time-consuming for the community to help.
Forgot to tell you that aside from those identifiers that are hidden, some columns are originally hidden and can be toggled by the user. So that action I think is not fit to the criteria. Here's the sample oml, I can't share the original app. I want to hide the sample id and MainId in the task tab but if I use a css, it is affecting the column picker in the employee tab. Thanks!
Yes, that's what I want to achieve but I tried that method in the orig app and it's not working on my side. Is this how you did it? I already set the column visible = false and canbehidden = false. Thanks.
Nevermind. Figured it out already haha but will try if this works when I get access to our app again. Thank you!