fields.className
fields.className
Editor v1.4.2 with Bootstrap v3.3.4. Inline.
It appears that fields.className
does not add a class to the field container. Or at least not where I would expect it with Bootstrap.
Debugger shows:
<input class="form-control" id="amt1" type="text" maxlength="14">
I expect to see this:
<input class="form-control my-class" id="amt1" type="text" maxlength="14">
Assuming this:
{
"name": "fltAmount1",
"type": "text",
"attr": {"maxlength": 14},
"className": "my-class",
"id": "amt1"
},
Is this a bug, or am I expecting the wrong thing?
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The class name is added to the field wrapper (which the documentation refers to as the "container") rather than the input element itself. For that you could use the
attr
option:The other option is to use the
field().input()
method to get the node and use$().addClass()
.Allan