Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82265

Classname set on Editor field is not passed into form

$
0
0

Description of problem:
I want to dynamically mark certain fields in the main Editor form. To that tend I am adding the class c9mandatory to the relevant fields like this in preOpen and in initCreate

    if (c9.appVar.options.editorUseFormEntry) {
        let mandatoryColumnNames = c9.appVar.document.chronology.getMandatoryColumnNames();
        for (let i = 0, fieldName; i < c9.appVar.editor.fields().length; i++) {
            fieldName = c9.appVar.editor.fields()[i];
            if (mandatoryColumnNames.includes(fieldName)) {
                c9.appVar.editor.field(fieldName).className = 'c9mandatory';
            }
        }
    }

I can see the class name is added to the fields, but when the form opens there is no mention of it. I hope you will see what I mean in the following screenshot:

I tried to set up a suitable jsbin, but kept getting script errors.


Viewing all articles
Browse latest Browse all 82265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>