====== Angular eg-grid component ====== ===== Setting up a new grid ===== * Defining the persistKey and adding the workstation setting SQL for saving grid settings * Choosing the data source and setting up ''GridDataSource.getRows()'' * Fleshing linked fields * Handling linked fields using CStore when PCRUD is not available (i.e. org unit settings) * Joining tables via PCRUD ops * Prepending data (see Acquisitions line item search) * Filtering * Sorting ==== Grid columns ==== * Automatic columns from IDL fields * Renaming columns * Hiding IDL columns * Defining grid cell templates and text generators for columns ==== Grid cells ==== * [[dev:eg-grid:styling|Styles based on column names and data types (WIP)]] * [[https://github.com/berick/Presentations/blob/main/Pending/newdevs.md#grid-cell-templates|Grid cell templates tutorial]] * Note that ''(click)'' actions in grid cells' child buttons should call ''$event.preventDefault()'' and ''$event.stopPropagation'' to prevent the row selection event from firing * [[newdevs:code:grid-cell-text-generator|Grid cell text generator]] -- setting up print templates for custom grid cell templates that contain links and buttons ==== Grid toolbar buttons, actions, and context menus ==== * Filters button (always leftmost) * Button colors and (TK) button style directive * Template areas before and after each button (primarily for [[https://getbootstrap.com/docs/5.3/forms/input-group/|input groups]]) * Grouping actions * Note that toolbar buttons could be grouped into dropdowns in AngularJS, but this has never been implemented in Angular * Right-click context menus * Double-click row actions * ''$event'' and ''context.getSelectedRows()'' * Special instructions for file download buttons ==== Grid filtered view links ==== * (new in 3.14) See ''.eg-grid-filter-links'' in ''staff/share/buckets/record-bucket.component.html'' and ''getViewKeys()'' in ''staff/share/buckets/record-bucket.component.ts'' * Constructing URLs to filtered grid views ===== AngularJS grids ===== TODO: explanation of flexbox in AngularJS vs. tables in Angular; see [[https://bugs.launchpad.net/evergreen/+bug/1615781|Bug #1615781]]