Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
admhemed
Frequent Visitor

destroy never triggers

Destroy event never ever triggers,

I need this event to know when user removes the visual, 

any solution or work around?

 


module powerbi.extensibility.visual {
"use strict";

export class Visual implements IVisual {
constructor(options: VisualConstructorOptions) {
}


public update(options: VisualUpdateOptions) {
}
public destroy(): void {
console.log('%c destroy ', 'background: #222; color: #bada55');
}
}
}

 

3 REPLIES 3
v-viig
Community Champion
Community Champion

This issue is on backlog.

 

Could you please describe why you need to know when user removes a visual?

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

 

I'm saving state for each of my visuals, and I need to know when a user removes the visual to correctly update the state.

Currently I'm using a socket io disconnect event as a work around, but it is not good enough, because the socket disconnects when user refreshes the page for example. 

v-viig
Community Champion
Community Champion

Thanks for the clarification. PBI CV API team will work on this issue but there's no ETA.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.