Forum Discussion
Visual.update() not triggered when switching from Reading to Edit View
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:
Directly after loadSwitching to EditAfter resizing visual in Edit ModeSwitching to Advanced Edit ModeGoing back to Reading view
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
- blumi788 years agoHelper I
Of course I have, as you can see at the top. If I would have not, update() won't be triggered at all.
- v-viig8 years agoCommunity Champion
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
- blumi788 years agoHelper I
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.
- Alex_Koch1 year agoFrequent Visitor
I am facing the same problem. When will it be solved?