newdevs:code:angular-field-order
This is an old revision of the document!
New Developers Working Group
Control Angular Form Field Order
If you do not specify the field order when opening an Angular form in a modal, the fields will be displayed in alphabetical order. This can be very confusing, so it is good practice to add a fieldOrder parameter to the relevant HTML file.
An example of this can be seen in admin-carousel.component.html:
<eg-fm-record-editor #editDialog idlClass="{{idlClass}}" [preloadLinkedValues]="true" fieldOrder="owner,name,type,age_filter,max_items,owning_lib_filter, copy_location_filter,active,id,bucket,last_refresh_time,creator, create_time,editor,edit_time" hiddenFieldsList="creator,editor,create_time,edit_time" [preSave]="mungeCarousel" (recordSaved)="postSave($event)" readonlyFields="last_refresh_time" [fieldOptions]="{bucket:{customTemplate:{template:bucketTemplate}}, copy_location_filter:{customTemplate:{template:locationTemplate}}, owning_lib_filter:{customTemplate:{template:orgTemplate}}}"> </eg-fm-record-editor>
Things to add to this page:
- Create example of controlling the form field order on a modal - use the patch here to work from: https://bugs.launchpad.net/evergreen/+bug/1857351
newdevs/code/angular-field-order.1676398474.txt.gz · Last modified: 2023/02/14 13:14 by tmccanna