editor template rendering

editor template rendering

montoyammontoyam Posts: 568Questions: 136Answers: 5
edited April 2020 in Free community support

I am using the template feature of the editor. I am adding a class to the editor field here:

On my machine at home the elements render like this (using inspect) so my js code will work as I refer to an element within a div with class 'lockable'

However, on my machine at work, the elements render different. The input element is not within the div:

so my code will not work:

                    $(".imported").find(":input").attr('readonly', isLocked);
                    $(".imported").find("select").attr('disabled', isLocked);

why would the two machines render the Editor template differently?
Note: at home I called the class lockable, at work I called it 'imported', sorry for any confusion when comparing the two.

Answers

  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    I tried this, but when editor rendered the form it took out my div :(

                        <div class="imported">
                            <editor-field name="Submissions.SubmissionTypeID" class="imported"></editor-field>
                            <editor-field name="Submissions.EmployeeName" class="imported"></editor-field>
                            <editor-field name="Submissions.EmployeeEmail" class="imported"></editor-field>
                            <editor-field name="Submissions.EmployeeDepartment" class="imported"></editor-field>
                        </div>
    
  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    ah ha!!!! I see what I did. On the one that "works", for the template I used:

    <div data-editor-template="Submissions.SubmissionID"></div>
    

    not the code above.

This discussion has been closed.