Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello,
We have created a custom widget which opens an image & we are doing some operations on that image.
We want that widget should be responsive. It should take all available space.
Can anyone please tell me how to do it?
Thanks & Regards,
Renuka Patil
Solved! Go to Solution.
Hello Renuka Patil,
If I remember correctly you need to:
1. Add a property to your widget in the *.ide.js file:
this.widgetProperties = function () {
return {
// ...
'supportsAutoResize': true,
// ...
}
}
2. Then in your *.runtime.js file you could relate to the property:
this.properties.ResponsiveLayout
Which should be equal to true, if the widget is placed in the responsive container.
3. And then you could:
if(this.properties.ResponsiveLayout) {
var width= this.jqElement.width();
// ...
}
this.resize = function(width,height) {
// invoked when widget is resized
}
Hope I don't forget something.
Regards,
J.
Hello Renuka Patil,
If I remember correctly you need to:
1. Add a property to your widget in the *.ide.js file:
this.widgetProperties = function () {
return {
// ...
'supportsAutoResize': true,
// ...
}
}
2. Then in your *.runtime.js file you could relate to the property:
this.properties.ResponsiveLayout
Which should be equal to true, if the widget is placed in the responsive container.
3. And then you could:
if(this.properties.ResponsiveLayout) {
var width= this.jqElement.width();
// ...
}
this.resize = function(width,height) {
// invoked when widget is resized
}
Hope I don't forget something.
Regards,
J.
Hello Jakub,
Thanks for the reply.
I tried your suggestion, it is working fine.
Thanks & Regards,
Renuka
Hi Renuka Patil,
Glad that I could help. In case of any further questions, don't hesitate to ask here on Community.
Regards,
J.
Hello Jakub, could you share a link where to find documentation on getting started with custom widgets in Thingworx ?
Thank you,
Tom
Hello,
You can find it on the marketplace under the Eclipse Plugin.
Regards,
J.