Forum Discussion

mikihiir's avatar
mikihiir
Helper III
7 years ago
Solved

Call public update(options: VisualUpdateOptions)

Hei

 

What is the best way to call  -> public update(options: VisualUpdateOptions)  without resizing

 

Thanks in advance :)

 

  • v-viig's avatar
    v-viig
    7 years ago

    The update method is called every time any filter or selection is applied or there's a change in Formatting Panel for this visual.

     

    You can call it whenever you want from your code. You just need to keep the update options or split update method into a few methods. We usually split update into the update and render.

     

    The update indicates a change in data. The render indicates a rendering flow.

     

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]

3 Replies

  • v-viig's avatar
    v-viig
    Community Champion

    Do you want to avoid calling the update method if a user resizes your visual?

     

    If so, you can detect a type of update by using VisualUpdateOptions.type (you get VisualUpdateOptions in the update method).

    The type allows detecting an update type.

     

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]

    • mikihiir's avatar
      mikihiir
      Helper III

      Nope

       

      I want to call it when ever i want to, lets say i select a dropdown value  and after that i need update method to be triggered.

       

      Thanks.

      • v-viig's avatar
        v-viig
        Community Champion

        The update method is called every time any filter or selection is applied or there's a change in Formatting Panel for this visual.

         

        You can call it whenever you want from your code. You just need to keep the update options or split update method into a few methods. We usually split update into the update and render.

         

        The update indicates a change in data. The render indicates a rendering flow.

         

        Ignat Vilesov,

        Software Engineer

         

        Microsoft Power BI Custom Visuals

        [email protected]