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?
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
Never mind, got it to work, simple as expected.
editor.field('AirCell.Description').focus();