Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
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);
@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
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. 🙂