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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
ssergs82
Regular Visitor

tileLoaded event fired n*n times for n tiles

I trying to create 4 different tiles in 4 different elements with

var powerBITile1 = powerbi.embed(tileConatiner1, config1);

...

var powerBITile4 = powerbi.embed(tileConatiner4, config4);

 

After that I attached to tileLoaded event

powerBITile1.off("tileLoaded");

powerBITile1.on("tileLoaded", function (event) {  });

...

powerBITile4.off("tileLoaded");
powerBITile4.on("tileLoaded", function (event) {  });

 

But tileLoaded event fired 16 times! What is wrong here and how to fix it? thanks

2 REPLIES 2
ssergs82
Regular Visitor

There is temporary solution (until it will be fixed in powerbi library)

// create event handler
var eventMethod = "addEventListener";
var eventer = window[eventMethod];
var messageEvent = "message";

// Listen for messages from iframes
eventer(messageEvent, function (event) {
	var powerBiTile = _.find(powerbi.embeds, function (powerBiTile) {
		return powerBiTile.iframe.contentWindow === event.source;
	});

	if (powerBiTile) {
		processMessageForTile(powerBiTile, JSON.parse(event.data));
	}
}, false);
Eric_Zhang
Employee
Employee


@ssergs82 wrote:

I trying to create 4 different tiles in 4 different elements with

var powerBITile1 = powerbi.embed(tileConatiner1, config1);

...

var powerBITile4 = powerbi.embed(tileConatiner4, config4);

 

After that I attached to tileLoaded event

powerBITile1.off("tileLoaded");

powerBITile1.on("tileLoaded", function (event) {  });

...

powerBITile4.off("tileLoaded");
powerBITile4.on("tileLoaded", function (event) {  });

 

But tileLoaded event fired 16 times! What is wrong here and how to fix it? thanks


@ssergs82

Thanks for reporting this. I can reproduce the same behavior. I'm consulting this behavior internally and would post back if I get any update. Thanks for your understanding and patience. 🙂

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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