cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cantoneye Frequent Visitor
Frequent Visitor

Custom Visual: Slicer selection display won't stay when page changes. (Visuals will reload)

Hi there,

 

I developed a timeline slicer. Everything works fine except that I realised the selection display won't stay when I shifted page. I know when page changes, the visual will automatically reload and hence runs the constructor and reset the visual to default state. How can I prevent the reload or set the constructor to reload the previous status? Is it the workaround something to do with bookmarking? Ken

2019-10-14_1250.pngSlicer date range displayed2019-10-14_1251.pngSlicer date range disappeared after reload.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-evelk Senior Member
Senior Member

Re: Custom Visual: Slicer selection display won't stay when page changes. (Visuals will reload)

Hi,

 

You are right, you can restore filter from update options.

If you use API 2.2 or higher, you will be able to read property jsonFilters from Options parameter inside Update method.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

View solution in original post

4 REPLIES 4
v-evelk Senior Member
Senior Member

Re: Custom Visual: Slicer selection display won't stay when page changes. (Visuals will reload)

Hi,

 

How do you pick the data in the slicer, through a Selction mechanism or Filter API?

If you work with a slicer it is recommended to use the second option.

Also, every time when you change the size of a visual, the Constructor woun't be called, only Update method will be.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

cantoneye Frequent Visitor
Frequent Visitor

Re: Custom Visual: Slicer selection display won't stay when page changes. (Visuals will reload)

Hi Evgenii,

I use Filter API. So I have no problem with the filter even though the page changes and the visual reload, the data is still filtered. However, the visual needs to display which is filtered. When page changes or the dashboard refresh, I think the visual will reload and the Constructor will be called. I believe something must be done in the Constructor to call back my previous status.

v-evelk Senior Member
Senior Member

Re: Custom Visual: Slicer selection display won't stay when page changes. (Visuals will reload)

Hi,

 

You are right, you can restore filter from update options.

If you use API 2.2 or higher, you will be able to read property jsonFilters from Options parameter inside Update method.

 

Kind Regards,

 

Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
pbicvsupport@microsoft.com

View solution in original post

cantoneye Frequent Visitor
Frequent Visitor

Re: Custom Visual: Slicer selection display won't stay when page changes. (Visuals will reload)

Thanks for your help!! It works now.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 3,293 guests
Please welcome our newest community members: