Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
hello,
I want to get the screen size, how do I do it on ThingWorx 9.3.2
what I have tried :
//This will return a string for the resolution Output = screen.width + "x" + screen.height
Detect Resolution of Monitor viewing a ThingWorx Mashup
and
console.log("Width: " + screen.width);
console.log("Height: " + screen.height);
still can't get resolution please suggest thanks you.
Hello,
Seems like it is not supported in 9.3 as per the support ticket;
There doesn't seem to be any documentation in the PTC Help Center that this has been deprecated though.
I did try some of the "TW" functions to see if I could find something similar, but wasn't able to. I thought that perhaps "TW.Runtime.Workspace.Mashups.Current.UI" would have the screen size in its return.
Perhaps someone else has a good workaround for this.
Regards,
Jens
I have tried TW.Runtime.Workspace.Mashups.Current.UI
result is undefined
Hello,
In 9.3 this won't be possible without implementing a custom extension. Usually, it's possible to work around the need for getting the screen resolution. What is your scenario, why do you need it?
/ Constantine
Hello @Constantine ,
I want to set CellWidthField of the collection widget by screen resolution.
Scenario is
And i tried using CSS to set MashupWidth but still can't set width.
Thank you for your help
If you want the collection cell to be the whole width of the container, not matter the width, set these settings like this:
View: Flow,
MashupWidth: 9999
FlowLayoutGravity: Expand
The Expand on the MashupWidth will act as a minimum width OR if it's something huge like 9999 it will span the whole width of the container.
Hope it helpes,
Gabriel - IQNOX
Hello,
Just wanted to post an update here as I just realized I missed the most obvious thing in the PTC help center link from my previous post which clearly states that the following should be supported.
But I can at least not get the "TW.screen.width/TW.screen.height" to work.
Perhaps it would be good to open a support ticket for this.
Regards,
Jens