Skip to main content
pshashipreetham
18-Opal
18-Opal
September 8, 2022
Solved

Get Client Screen Resolution

  • September 8, 2022
  • 2 replies
  • 2019 views

Hi

Is there a way to get the client screen resolution on Load of Mashup, such that based on it, Mashup made for that particular Screen resolution can be loaded.

As we know a perfect responsive Mashup can't be made since there are less Responsive Widgets present in Thingworx, eventually end up showing the scroll bars in the Mashup.

Thanks,

Best answer by nmilleson

In ThingWorx 9.0, I'm able to access screen.width and screen.height in an Expression function:

 

console.log("Width: " + screen.width);
console.log("Height: " + screen.height);

nmilleson_0-1662671615979.png

 

That may help

 

-Nick

2 replies

nmilleson17-PeridotAnswer
17-Peridot
September 8, 2022

In ThingWorx 9.0, I'm able to access screen.width and screen.height in an Expression function:

 

console.log("Width: " + screen.width);
console.log("Height: " + screen.height);

nmilleson_0-1662671615979.png

 

That may help

 

-Nick

pshashipreetham
18-Opal
18-Opal
September 9, 2022

@nmilleson You are awesome, Thank you !

Thanks,

19-Tanzanite
September 9, 2022

Out of curiosity, how will mashup screen resolution will help in the context of a mobile device like Huawei P30 Pro which has a 1080 x 2340 resolution (close to laptop)?

 

pshashipreetham
18-Opal
18-Opal
September 9, 2022

Hi @VladimirRosu_116627 ,

So Team tried a lot to create a Responsive Mashup which gets adjusted to any resolution, but label, Buttons are not responsive and showing scroll bars, I agree that this Screen resolution will not help, as of now to do a workaround we are building based on few Resolutions of Client Displays, Meanwhile R&D Team will fix things.

Thanks,