newdevs:code:angular-field-order
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
newdevs:code:angular-field-order [2023/02/14 13:16] – 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 |
- | 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. | + | ===== Controlling Field Order ===== |
- | An example of this can be seen in admin-carousel.component.html: | + | If you do not specify the field order when opening an Angular form in a modal, the fields will be displayed |
+ | ==== Via the Routing Module ==== | ||
+ | |||
+ | 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 to the relevant HTML file: | ||
+ | |||
+ | < | ||
+ | |||
+ | An example of this in action can be seen in admin-carousel.component.html: | ||
+ | |||
+ | < | ||
< | < | ||
[preloadLinkedValues]=" | [preloadLinkedValues]=" | ||
Line 18: | Line 44: | ||
owning_lib_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 { | ||
+ | | ||
+ | | ||
+ | } | ||
- | See the example in git at: https:// | + | </code> |
newdevs/code/angular-field-order.1676398579.txt.gz · Last modified: 2023/02/14 13:16 by tmccanna