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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Users online (1,638)