Remove default behavior on selected items in Slicer


#1

I’m using the Slicer visualization in my dashboard and when I made a selection, all the time the selected items go to the top of the item list. I think that is a nice feature.

But what happens when I have a list with 10 or fewer items, and I don’t want the selected items to go to the top of the list. This is possible or I can’t do that?


#2

Hi @Paul , I understand. Not all the time the user wants the default behavior in Slicer visualization, but you can change that very easily. You just need to set the selectedOnTop property. You can use the following code: .set('selectedOnTop', false) inside the Slicer statement and that’s all, the next time you select an item it doesn’t go to the top of the list.


#3

Hi @arturo, that is very cool. I already test it on my dashboard and is very easy to configure.

Right now I’m using 5 Slicer components on my dashboard and I wonder if there is a way to not keep all the item list inside the Slicer. I mean, when a user selects one or more items, the Slicer keeps all the values not only the selected ones. Can I change this behavior?


#4

Hi @Paul, of course, you can do that. Similar to your previous question is very easy to do. You only need to set a property inside your Slicer definition. You can use this code: .set('noMerge', true). This option forces the Slicer component to keep only the selected items.