How do I get the correct identifier for an editing from that has fields from more than one table?

How do I get the correct identifier for an editing from that has fields from more than one table?

mike92117mike92117 Posts: 38Questions: 11Answers: 1

I'm trying to programmatically set focus to a particular field in the popup editor dialog under certain conditions. However, my form's fields are the result of joined tables and I'm using a template form so have data-editor-template code like this:

                                <div class="column">
                                    <div data-editor-template="AirCell.Name" id="tbName"></div>
                                    <div data-editor-template="AirCell.Description" id="tbDescription"></div>
                                    <div data-editor-template="Core.XDirection" id="tbXDirection"></div>
                                    <div data-editor-template="AirCell.FlowType" id="rbFlowType"></div>
                                    <div data-editor-template="AirCell.NeverDelete" id="tbNeverDelete"></div>
                                </div>

The trouble is if I try to set focus to the "AirCell.Description" field, I can only get it to work using the rather ugly jQuery selector:

$('#DTE_Field_AirCell-Description').focus();

I'd prefer to use something like editor.field(fieldName); to set focus. Except I'm not sure what the trick is for the correct identifier.

This question has an accepted answers - jump to answer

Answers

  • mike92117mike92117 Posts: 38Questions: 11Answers: 1
    edited September 2023 Answer ✓

    Never mind, got it to work, simple as expected.

    editor.field('AirCell.Description').focus();

Sign In or Register to comment.