Editor - Hot to Get ClassName Working

Editor - Hot to Get ClassName Working

andyrandyr 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

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Are you putting className in the attr list? If so, then the behaviour you are seeing is correct - there is not className 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 a className attribute.

    If you are using className in the field object (fields.className) then the class will be getting added to the field container.

    Allan

  • andyrandyr Posts: 35Questions: 6Answers: 0

    Thanks. I now see that using "fields.className"` adds that class to the field container. I was looking at the input element.

This discussion has been closed.