Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Is it possible to get Width and Height properties in code? I know these "general" properties are created by default once you add objects: {} in capabilities.json.
Based on some requirement and to achieve something, I want to access this width and height properties so I can modify it via code on the go.
To get these properties you can use:
@alihm Thank you for your reply.
what are pages[0] here? How can I access it in the visual.ts file? I only want to access the width and height of my custom visual.
This is a dropdown. Once I click it, it should open outside of the content area. As it is loading in an iframe, I can't achieve using CSS or javascript/jQuery methods available.
That's why I want to increase the width and height of this particular custom visual once the user opens the dropdown.
Please see this.
Hi aakash1401 ,
Inside visual.ts you have the update method, this is the function that gets called everytime the visual renders.
This method receives one argument of type "VisualUpdateOptions", inside this argument you have a property called viewport this property includes the width & height of the custom visual.
So basically inside the update method you can do:
let width = options.viewport.width;
let height = options.viewport.height;
Thanks,
Idan
@idgoldfa This just returns the value of height and width. Updating in visual.ts doesn't change its Width and Height that is present in 'General' format properties. Any idea how to do that.
@Anonymousunfortunately there is no API at the moment for modifying the height & width of a visual from inside the visual code.
@idgoldfa How can team accept it as Enhancement, Future release if this is applicable as a valid requirement.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
3 | |
2 | |
2 | |
1 |