Skip to main content
1-Visitor
August 9, 2018
Solved

Set class of 2d Container using javascript

  • August 9, 2018
  • 1 reply
  • 1317 views

Is there any way to set the class of a 2d container using javascript? Whenever I try to set the class using the following line of code:

$scope.app.view.Home.wdg["panel-2"]).class = "my-class";

I get an object undefined error.

 

Best answer by jmikesell

Not sure if this will work but try the "other" method of setting widget properties.

 

$scope.setWidgetProp(StudioID, Property, Value)

so for your example

$scope.setWidgetProp('panel-2', 'class', 'my-class')

1 reply

jmikesell1-VisitorAnswer
1-Visitor
August 9, 2018

Not sure if this will work but try the "other" method of setting widget properties.

 

$scope.setWidgetProp(StudioID, Property, Value)

so for your example

$scope.setWidgetProp('panel-2', 'class', 'my-class')
izdane1-VisitorAuthor
1-Visitor
August 10, 2018

Yep that worked thank you!