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
WZorn
Helper II
Helper II

Dialog Box for Custom Developed Visual?

 

I want a custom dialog box to display when a user clicks on an element within a visual.

 

I found the following page:

https://docs.microsoft.com/en-us/power-bi/developer/visuals/create-display-dialog-box#create-the-dia... 

 

The page describes how to build a date picker dialog.  In the new class, there are two import statements that I get an error on:

WZorn_0-1625598040305.png

 

The first error I encountered was that powerbi was not defined, but I fixed that by including the "import powerbi from "powerbi-visuals-api" before the lines above.

 

It looks like DialogConstructor Options is not a named member, nor is DialogAction.

 

Have there been changes that stopped this from working?  Has it been moved somewhere else?

 

Thanks,

William

 

 

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @WZorn,

I haven't personally used this functionality yet to assist in detail, but which version of powerbi-visuals-api is in your visual's package.json?

These interfaces are added in 3.7.0, so if this is older then you'll need to update this version, e.g. npm i powerbi-visuals-api@3.7.0 or @latest

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

3 REPLIES 3
dm-p
Super User
Super User

Hi @WZorn,

I haven't personally used this functionality yet to assist in detail, but which version of powerbi-visuals-api is in your visual's package.json?

These interfaces are added in 3.7.0, so if this is older then you'll need to update this version, e.g. npm i powerbi-visuals-api@3.7.0 or @latest

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Well, that's a step in the right direction.  I can see what's happening now.

 

When I run npm i powerbi-visuals-api@latest it installs version 3.8.2, but as soon as I execute pbiviz start, it reverts to 2.6.0.

 

AH.  The pbiviz.json still had the earlier version of the api referenced.

 

The line:

"apiVersion""2.6.0"
needed to be changed to:
"apiVersion""3.8.2",

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.