Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
When switching from Edit to Reading View, Visual.update(options) is triggered and options.viewMode is set to 0.
Vice versa, when switching back to Edit View, Visual.update() ist NOT triggered and therefore I can not react to this event.
In the upcoming calls to Visual.update (like on data change or resizing), options.viewMode is 1 as expected.
Related, the typedef of ViewMode is
const enum ViewMode { View = 0, Edit = 1, InFocusEdit = 2, }
- but value 2 never occured in my occasions. What is "InFocusedEdit"?
We can reproduce the same bug with the following steps:
It works well on my side with Dot Plot custom visual. Can you share code of update method?
InFocusEdit is an focus mode that can be activated by opening ... menu in the right top corner of a csutom visual.
Then you should select Edit. Please note a csutom visual must specify advancedEditModeSupport: true in the capabilities to support Focus Edit Mode.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Just create a new Custom Visual:
> pbiviz new example
then change the update() function to display the viewMode and editMode flags:
public update(options: VisualUpdateOptions) { if (typeof this.textNode !== "undefined") { this.textNode.textContent = "ViewMode: " + options.viewMode.toString() + ", EditMode: " + options.editMode; } }
And insert this into capabilities:
"advancedEditModeSupport": 2,
Results:
As you can see, Switching to edit mode does not change the ViewMode (or EditMode), it needs the second update (data or resize update). And viewMode never gets value 2.
Have you filled all of required data fields?
I guess this is a root case of the issue.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Of course I have, as you can see at the top. If I would have not, update() won't be triggered at all.
Could you please share source code and data-set for further investigation as it works well on our side?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Hey @v-viig
after setting this issue away for some time, wondering why no one is able to reproduce it, I think, I found why:
It happens *only*, when the view mode is switched to "Actual Size". Which I'm doing almost always.
In other viewing modes, each switch of the Edit/Reading-Mode triggers a resize event and with this, the update() options contains the new mode flag.
Is it a blocking issue for you or your customers?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
@v-viig I'm calling it a soft-blocker. We have to put this workaround in our documentation as "a Power BI issue, which may be solved later". Can you reproduce it now?
We'll put this issue into Power BI backlog for further investigation.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I have also come across this problem. Is there as update on this, is it still in your backlog?
already posted this in the "Service" board, but maybe it belongs here also:
When switching from Edit to Reading View, Visual.update(options) is triggered and options.viewMode is set to 0.
Vice versa, when switching back to Edit View, Visual.update() ist NOT triggered and therefore I can not react to this event.
In the upcoming calls to Visual.update (like on data change or resizing), options.viewMode is 1 as expected.
Related, the typedef of ViewMode is
const enum ViewMode { View = 0, Edit = 1, InFocusEdit = 2, }
- but value 2 never occured in my occasions. What is "InFocusedEdit"?
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
42 | |
4 | |
4 | |
3 | |
3 |