Forum Discussion

satishr's avatar
satishr
Icon for Helper III rankHelper III
8 years ago
Solved

Revert to default option doesn't work in my custom visual

I have developed a simple custom visual following the documentation available. I have created few format options in the capabilities.ts file and have assigned values to them in visual.ts using variab...
  • v-viig's avatar
    8 years ago

    You use single variable to keep the default value and current value.

    That means, you should move default values to new variables and use them if and only if the property is undefined in metadata.

     

    this.kpiName = options.dataViews[0].metadata.objects["kpiName"] && options.dataViews[0].metadata.objects["kpiName"]["name"]
        ? this.kpiName = options.dataViews[0].metadata.objects["kpiName"]["name"].toString()
        : "KPI Name";

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]