cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
By default, BloX will use the first element in your dropdown as the default text in the dropdown box.
Instead of this value, the following method adds a different default non-selectable value.

Steps For Implementation

  1. Add the addPlaceholder class to your Input.ChoiceSet
  2. Add the following script to the script of your BloX widget
$('.addPlaceholder').prepend('<option value=\"\" disabled selected>Select Filter</option>')
You can update the text "Select Filter" in the script above to customize the placeholder text.
Rate this article:
Comments
taras
Sisense Team Member
Sisense Team Member

To extend the above logic for the dropdown to dynamically display the actual Filter value, the following script improvement can be used:

widget.on('ready',(w, args)=>{
	var tempFilter = 'All Items';
	if (prism.activeDashboard.filters.$$items[0].jaql.filter.members) tempFilter = prism.activeDashboard.filters.$$items[0].jaql.filter.members.toString();
	$('.addPlaceholder').prepend('<option value=\"\" disabled selected>'+tempFilter+'</option>');
});

The above takes the first dashboard filter values and puts them as the first item on a drop-down list. Otherwise, "All Items" is displayed.

Tested on Sisense Version: L2023.11.0.279.

Version history
Last update:
‎03-02-2023 09:39 AM
Updated by:
Contributors