Forum Discussion

ankitvijay's avatar
ankitvijay
Cloud Apps
02-18-2022
Solved

Setting default filters through iframe query or disable "reset to default filter option"

Hi team. We are loading the sisense dashboard through an iframe, and we are passing filters as query parameters in the iframe URL as mentioned here https://sisense.dev/guides/embedding/iframe.html#_...
  • ankitvijay's avatar
    ankitvijay
    02-21-2022

    Hi harikm007,

    Thanks for your response. This code worked. However, instead of selecting the button by title, I went for a slightly different approach by removing the siblings of the filter filter-title class. I also removed the "Restore" and "Add filter" icons explicitly, as I could see these icons flashed for a millisecond on load before getting removed. My overall code looks like below:

     

    dashboard.on('initialized', function(se, ev){
    	se.userAuth.dashboards.filters.set_defaults = false;	
     	$('#general-restore-usage').remove();
    	$('#general-plus').remove();	
    })
    
    dashboard.on('refreshstart', function(se, ev){
    	// Remove the restore button
    	$('.filters-title').siblings().remove()
    })

     

    Hope it can help others.