cancel
Showing results for 
Search instead for 
Did you mean: 

How do i disable toggle switch button in filterpane?

frankmol
7 - Data Storage
7 - Data Storage

Hi,

For my dashboard, I would like to disable or delete the toggle switch buttons in the filter pane (shown in the picture), so the users of the dashboard do not have the option to turn them on or off.

I can't seem to find the option in menus. Is it possible to edit the script using JavaScript?

Thanks!

frankmol_0-1684152551795.png

 

 

2 ACCEPTED SOLUTIONS

Angelina_QBeeQ
10 - ETL
10 - ETL

Hi @frankmol,

You can try the next script to hide toggles:

var filterText = ['Country','Segment']; // add here the names of the filters

dashboard.on('refreshstart', (el, args) => {
hideFilterToggle(el, args);
});

dashboard.on('widgetready', (el, args) => {
hideFilterToggle(el, args);
});

var hideFilterToggle = (el, args) => {
 for (index = 0; index < filterText.length; index++) { 
 var tag = $('span.ew-i-caption:contains(' + filterText[index] + ')', $('div.ew-panel'));
 $('label.custom-togglebtn__label', tag.parent().parent().parent().parent()).remove();
} 
}

Hope this helps you.

Always here to help,

Angelina from QBeeQ
angelina.bulgakova@qbeeq.io
QBeeQ  - Gold Implementation and Development Partner

View solution in original post

You can hide all toggles from the dashboard with this script:

dashboard.on('refreshstart', (el, args) => {
hideFilterToggle(el, args);
});

dashboard.on('widgetready', (el, args) => {
hideFilterToggle(el, args);
});

var hideFilterToggle = (el, args) => {
 for (index = 0; index < args.dashboard.filters.$$items.length; index++) { 
 $('label.custom-togglebtn__label').remove();
} 
}

View solution in original post

3 REPLIES 3

Angelina_QBeeQ
10 - ETL
10 - ETL

Hi @frankmol,

You can try the next script to hide toggles:

var filterText = ['Country','Segment']; // add here the names of the filters

dashboard.on('refreshstart', (el, args) => {
hideFilterToggle(el, args);
});

dashboard.on('widgetready', (el, args) => {
hideFilterToggle(el, args);
});

var hideFilterToggle = (el, args) => {
 for (index = 0; index < filterText.length; index++) { 
 var tag = $('span.ew-i-caption:contains(' + filterText[index] + ')', $('div.ew-panel'));
 $('label.custom-togglebtn__label', tag.parent().parent().parent().parent()).remove();
} 
}

Hope this helps you.

Always here to help,

Angelina from QBeeQ
angelina.bulgakova@qbeeq.io
QBeeQ  - Gold Implementation and Development Partner

Hi Angelina,

Thanks, this works perfectly for single filters, but when I add a dependent filter, the toggle button reappears. Is it possible to hide these toggle buttons as well?

Thanks again for your help!

Regards,

Frank

You can hide all toggles from the dashboard with this script:

dashboard.on('refreshstart', (el, args) => {
hideFilterToggle(el, args);
});

dashboard.on('widgetready', (el, args) => {
hideFilterToggle(el, args);
});

var hideFilterToggle = (el, args) => {
 for (index = 0; index < args.dashboard.filters.$$items.length; index++) { 
 $('label.custom-togglebtn__label').remove();
} 
}