Hi,
I have a responsive form to which I have added a container with 1 row and 1 column. The row has been given a name and I now want to change the class on this row in my .js file.
With normal elements I just use:
elements.elementname.addStyleClass("newClassName")
Unfortunately, the name of the row does not show up in autocomplete when I type elements so how would I add or remove a class on the row programmatically?
Thanks
Steve
Hi,
containers such as row and columns are stateless, is not possible to change their class at runtime.
If you really need to change the style of a layout container at runtime, rather than adding the class to the container, you may add the class to the form itself using plugins.ngclientutils.addFormStyleClass(formname,styleclass);
In CSS you can then target the container contained by the form
.runtimeclass-added-toform .row.your-row-name { ... }
This code will target any row having class “.your-row-name” contained by the form .
You should make sure yourself to use an unique class name to the row you want to style, in this way you avoid conflicts with other use cases.
Regards,
Paolo