on 05-04-2017 3:32 PM
Hi,
I am developing a Design Studio custom component and I am facing and annoying issue. The following first lines of component.js code is used to retrieve the height of the
////////////////////////////////////////////////////////////
this.init = function() {
outerWidth = this.$().width();
outerHeight = this.$().height();
The problem we face is that on several times the value of the height retrieved by the jquery statement is 0. Problems seems to appear when sthe property height of the component is set to auto. If the value is hardcoded the jquery statement works fine.
Anyon knows how to manage this issue?
Thanks,
Alfons
Any idea about?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
After additional testing we have found that problem appears if these 2 conditions (quite common are fulfilled)
- Component is in a Panel (if the component is directly on the Layout it does works)
- Layout Height Component Property is set to AUTO (if component layout height is set to a fixed value -e.g: 100- it does work fine even if component is in a layout)
It seems that by some reason the rendering of the Custom DS code is executed when the size of the panel is not completely calculated. This would explain why jquery does provide a 0.
Use of components in panels with an automatic size is a quite common scenario: how to be able to retrieve the final value of the layout in the component.js? Does it exist any way to obtain these values?
Thanks
Alfons
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.