Hide Columns from the Filter list - Implementation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 02:45 AM
Hello everyone,
I stumbled upon a community article to hide some columns from filter list
This article helps / explains, using a secript, to hide the column only from the filter list but keep it in the list view and it's given a UI script there.
I'm unsure how to implement it or if thats solution is still valid, could anyone clarify on how to execute it? or on how to achieve that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 05:20 AM
Hi @Ariel Aharon ,
You can try using a UI Script -
Can you please try this code once-
addLoadEvent(function() {
var tableName = g_list.getTableName();
var columnsToHide = ['column_to_hide1', 'column_to_hide2']; // Replace with your columns
if (tableName === 'your_table_name') { // Replace with your table name
setTimeout(function() {
columnsToHide.forEach(function(column) {
g_filter.removeChoice(column);
});
}, 500); // Delay to ensure filter is ready
}
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 06:31 AM - edited 09-08-2024 06:31 AM
Hey,
I tried this script, and it basically messed up UI functionallity (in console it showed g_list and / or fields variable is not defined) and no context menu was showing, as well as UI actions we're not responding.
I reverted changes using Background Script turning that UI Script off.
Is there an official doc on how to create load / change / submit *UI Scripts*?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2024 04:42 PM - edited 09-08-2024 04:44 PM
Hi @Ariel Aharon ,
The issue seems to be the timing of the list load.
Ensure the script runs after the UI elements are loaded.
Not sure of any other approach for this.
Take a look into this thread-