newdevs:code:angular-field-order
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| newdevs:code:angular-field-order [2023/01/19 12:32] – created tmccanna | newdevs:code:angular-field-order [2024/06/05 13:29] (current) – [Adding Field Row Styling to Modals] tmccanna | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| **New Developers Working Group** | **New Developers Working Group** | ||
| - | ====== Control | + | ====== Control Field Order and Styling in Form Modals |
| + | ===== Controlling 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. To improve readability and usability, it is best to specify the desired field order either through the relevant routing module (for dynamically-created interfaces) or through the HTML template (for interfaces that have additional customizations). | ||
| + | ==== Via the Routing Module ==== | ||
| - | ===== Things to add to this page: ===== | + | When you are working with a basic, dynamically-created interface you can control the field order by modifying the relevant **routing.module.ts** file. Note that you can also specify certain fields as visible but read-only. For example: |
| + | |||
| + | < | ||
| + | path: ' | ||
| + | | ||
| + | data: [{ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | A good example of this is in / | ||
| + | |||
| + | ==== Via the HTML Template | ||
| + | |||
| + | The grid column and modal field order can be controlled by adding the **fieldOrder** parameter | ||
| + | |||
| + | < | ||
| + | |||
| + | An example of this in action can be seen in admin-carousel.component.html: | ||
| + | |||
| + | < | ||
| + | < | ||
| + | [preloadLinkedValues]=" | ||
| + | fieldOrder=" | ||
| + | copy_location_filter, | ||
| + | create_time, | ||
| + | hiddenFieldsList=" | ||
| + | [preSave]=" | ||
| + | readonlyFields=" | ||
| + | [fieldOptions]=" | ||
| + | copy_location_filter: | ||
| + | owning_lib_filter: | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Note that you can also make use of the **hiddenFieldsList** parameter for fields that do not need to show on the form, and of the **readonlyFields** parameter to make specified fields uneditable. | ||
| + | |||
| + | ===== Adding Field Row Styling to Modals ===== | ||
| + | |||
| + | Beginning in Evergreen 3.13 ([[https:// | ||
| + | |||
| + | First, you will need to identify the fieldmapper' | ||
| + | |||
| + | Then, modify **eg2/ | ||
| + | |||
| + | < | ||
| + | .row { | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | /* Modal for Local Admin > Hold Policies */ | ||
| + | .chmm .row.item_owning_ou, | ||
| + | .chmm .row.user_home_ou, | ||
| + | .chmm .row.holdable, | ||
| + | .chmm .row.requestor_grp { | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | </ | ||
| - | * Create example of controlling the form field order on a modal - use the patch here to work from: https:// | ||
newdevs/code/angular-field-order.1674149561.txt.gz · Last modified: 2023/01/19 12:32 by tmccanna