Editor - Hot to Get ClassName Working
Editor - Hot to Get ClassName Working
andyr
Posts: 35Questions: 6Answers: 0
For a n Editor "fields" option I can only get the "class" working. Using the "className" property does nothing.
How can I get this working. This is for IE 11.
var editor = new $.fn.dataTable.Editor({
...
{
"label" : "Avail Start",
"name": "TSSRAvail.AvailStart",
// Does not work: "className": "requiredEdit"
"attr": { "class" : "requiredEdit" }
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Are you putting
className
in theattr
list? If so, then the behaviour you are seeing is correct - there is notclassName
attribute in HTML (if you use the browser's inspect you would probably see that it has been added to the element, but it won't have any effect since, as I say, HTML doesn't use aclassName
attribute.If you are using
className
in the field object (fields.className
) then the class will be getting added to the field container.Allan
Thanks. I now see that using "fields.className"` adds that class to the field container. I was looking at the input element.