Input Widget Rendering for 5.18+

3
Now that 5.18 has introduced the new pattern to generate input controls similar to how Bootstrap suggests creating them (see http://bootstrapdocs.com/v3.2.0/docs/css/#forms for more details), I am trying to create an input widget to have the same behavior. My issue is getting access to the DataView to know how to render the label correctly. I need to access both the Label width property and Form orientation property. Without those, the input control can't render like the existing controls.
asked
2 answers
0

Can you use dijit.getEnclosingWidget to reach the parent data view widget? Perhaps loop on that until you find an enclosing data view?

answered
0

In the Modeler you can set the form orientation and the label width on a DataView, but there is no widget in the client with knowledge about these properties. These properties only control how the Modeler exports certain CSS classes.

In a custom widget you can only retrieve the form orientation by verifying whether the "form-horizontal" CSS class is present on the DataView. As for the label width, it's exported on the label tag as the "col-sm-X" class (the label also has the "control-label" class).

answered