Forum Discussion
acarlson
4 years agoRegular Visitor
Get slicer data from selectionChanged event
Seems like a simple thing to do but I'm not able for figure this one out. I am embedding a visual (slicer), attaching an event handler for "selectionChanged" and just trying to get the values of ...
acarlson
4 years agoRegular Visitor
Hi Rico, thanks for the reply.
The selection changed event reference you gave seems to be for .net controls. I'm trying to get it through the power bi embedded javascript api. The timestamp slicer is an embedded visual, is it possible to get the selected items from within the javascript selectionChanged event?
This is what is returned from the event parameter
I tried using the getSlicerState() but that returns "getSlicerState is not a function" javascript error.
visual.on("selectionChanged", function (event) {
console.log(event);
let curV = powerbi.get(event.target);
curV.getSlicerState().then(slicerState => {
if (slicerState.filters.length > 0) filteredSlicers.push(slicerState)
})
});
Thanks!
Mestu_Paul
1 year agoHelper II
hello acarlson
Did you find any solution for this range slicer?