The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I am wanting to add a special menu option to buttons/shapes in an Embedded report via API, but it appears that Context Menu options don't show up for buttons. I've added a new commmand, which shows up just fine for standard visuals but no joy with buttons:
I'm using the PBI Embeded Playground to test out the API and cannot figure this out. Here's some of the relevant code for the playground:
const newSettings = {
extensions: [
{
command: {
name: "extension command",
title: "Extend command",
extend: {
// Define visualContextMenu to extend context menu.
visualContextMenu: {
// Define title to override default title.
//You can override default icon as well.
title: "Extend context menu",
menuLocation: models.MenuLocation.Top
}
}
}
}
]
};
// Update the settings by passing in the new settings you have configured.
try {
await report.updateSettings(newSettings);
}
catch (error) {
console.log(error);
}
// report.off removes all event handlers for a specific event
report.off("commandTriggered");
// report.on will add an event handler to commandTriggered event which prints to console window.
report.on("commandTriggered", function (event) {
let commandDetails = event.detail;
console.log("Event - commandTriggered:\n", commandDetails);
});
Solved! Go to Solution.
Hi @arpost ,
It seems no such a object for extending context menu on button/shape. You can submit your ideas on Power BI Ideas website.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @arpost ,
It seems no such a object for extending context menu on button/shape. You can submit your ideas on Power BI Ideas website.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.