Forum Discussion

amritbhgt's avatar
amritbhgt
Cloud Apps
01-08-2024
Solved

Need to change the filter colors when something is selected

Hi All,

I have several filters in my dashboard, i want to change the colors when something is selected in the filters to distinguish between selected and unselected filters . 

currently i am using 

$('.uc-tag').css('background-color','#006ecf');
$('.uc-tag').css('color','white');

as filter colors and background

  • Hi amritbhgt ,

    Here are some options to achieve this:

    1. Use below dashboard script to change the color of selected/unselected filters

    
    dashboard.on('refreshstart', function(dashboard, args){
    	
    	//color of selected filters
    	$('.uc-tag').css('background-color','#0f8037');
    	$('.uc-tag').css('color','white');
    	
    	//color of Include all
    	$('.uc-tag[title="Include all"]').css('background-color','#006ecf');
    	$('.uc-tag[title="Include all"]').css('color','white');
    
    	//color of unselected filters
    	$('.uc-tagline-content.exclude .uc-tag').css('background-color','#ab204f');
    	$('.uc-tagline-content.exclude .uc-tag').css('color','white');
    
    }) 

     

    2. Use Paldi premium Control Filter Colors plugin which will allow you to configure the colors and you don't need to apply any script in each dashboard.

     

     

    Feel free to reach out if you have further questions, we're always happy to help 🙂
    inquiries@paldi.solutions 
    Paldi Solutions, Number #1 Sisense Plugins Developer

     

  • Hi amritbhgt ,

    Make sure sure there is no other script in the dashboard/widgets to change the color of filters.

    $('.uc-tag').css('background-color','#006ecf');
    $('.uc-tag').css('color','white');

    Also make sure there is no other plugin that changes the color of filters.

    It would be good to try the script on  a new dashboard to verify it.

     

    Feel free to reach out if you have further questions, we're always happy to help

    inquiries@paldi.solutions 
    Paldi Solutions, Number #1 Sisense Plugins Developer

7 Replies

Replies have been turned off for this discussion
    • amritbhgt's avatar
      amritbhgt
      Cloud Apps

      This links redirects me to this page only, can you provide the code and updated link

  • Hi amritbhgt ,

    Here are some options to achieve this:

    1. Use below dashboard script to change the color of selected/unselected filters

    
    dashboard.on('refreshstart', function(dashboard, args){
    	
    	//color of selected filters
    	$('.uc-tag').css('background-color','#0f8037');
    	$('.uc-tag').css('color','white');
    	
    	//color of Include all
    	$('.uc-tag[title="Include all"]').css('background-color','#006ecf');
    	$('.uc-tag[title="Include all"]').css('color','white');
    
    	//color of unselected filters
    	$('.uc-tagline-content.exclude .uc-tag').css('background-color','#ab204f');
    	$('.uc-tagline-content.exclude .uc-tag').css('color','white');
    
    }) 

     

    2. Use Paldi premium Control Filter Colors plugin which will allow you to configure the colors and you don't need to apply any script in each dashboard.

     

     

    Feel free to reach out if you have further questions, we're always happy to help 🙂
    inquiries@paldi.solutions 
    Paldi Solutions, Number #1 Sisense Plugins Developer

     

    • amritbhgt's avatar
      amritbhgt
      Cloud Apps

      It changes the color for a second but once the view is loaded it again goes back to blue color(Include all Color)

      • Benji_PaldiTeam's avatar
        Benji_PaldiTeam
        Data Pipeline

        Hi amritbhgt ,

        Make sure sure there is no other script in the dashboard/widgets to change the color of filters.

        $('.uc-tag').css('background-color','#006ecf');
        $('.uc-tag').css('color','white');

        Also make sure there is no other plugin that changes the color of filters.

        It would be good to try the script on  a new dashboard to verify it.

         

        Feel free to reach out if you have further questions, we're always happy to help

        inquiries@paldi.solutions 
        Paldi Solutions, Number #1 Sisense Plugins Developer

  • DRay's avatar
    DRay
    Sisense Employee

    Hello amritbhgt,

    Did the solution offered by Benji_PaldiTeam work for you? If so, please click the 'Accept as Solution' button so that other members can easily find the answer. If not, please let us know so that we can continue to help you.

    Thank you, and have a great day!

  • DRay's avatar
    DRay
    Sisense Employee

    Hello @amritbhgt,

    Did the solution offered by @Benji_PaldiTeam work for you? If so, please click the 'Accept as Solution' button so that other members can easily find the answer. If not, please let us know so that we can continue to help you