Skip to main content
Nintex Community Menu Bar
Question

Is there formula syntax for viewport width?

  • July 12, 2024
  • 1 reply
  • 6 views

Forum|alt.badge.img+7

Is there formula syntax for viewport width?

Use case:

I load certain models after render using the Skuid Page: Rendered Event.

I would like to add a branch with an IF statement to load or not load specific models based on the viewport width so I can load specific models for mobile vs. desktop.

1 reply

Forum|alt.badge.img+17
  • Nintex Employee
  • July 12, 2024

Sorry Duane - there is not Formula Syntax for returning the current viewport width. There have been a number of snippet based approaches published here through the years that collect viewport on page load and update a UI Only field - which you then can use for the sort of branching you describe.

See this one:

Skuid, please implement this as declarative. (function(skuid){ var $ = skuid.$; $(document.body).one('pageload',function(){ var ADashUIOnly = skuid.$M('ADashUIOnly'), row = ADashUIOnly.getFirstRow(); window.addEventListener("resize", setWidth); function setWidth(){ ADashUIOnly.updateRow(row,'minWidth',$(window).width()); } }); })(skuid); See: “YouTube