newdevs:code:grid-cell-text-generator
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
newdevs:code:grid-cell-text-generator [2023/03/30 16:59] – created tmccanna | newdevs:code:grid-cell-text-generator [2023/12/21 16:54] – tmccanna | ||
---|---|---|---|
Line 4: | Line 4: | ||
When a grid cell (aka, column) is modified to include HTML such as a link, it will not print when printing the full grid unless you take the additional step of telling the system what to print. | When a grid cell (aka, column) is modified to include HTML such as a link, it will not print when printing the full grid unless you take the additional step of telling the system what to print. | ||
- | ===== Example of the Barcode | + | ===== Example of the Title Field in Holds Pull List ===== |
- | 1. The barcode field in staff/ | + | 1. An ng-template block in in staff/ |
< | < | ||
- | < | + | < |
- | <a href="/eg/staff/cat/item/{{hold.cp_id}}/summary"> | + | <a class=" |
- | | + | {{hold.title}} |
- | | + | |
- | </ | + | |
- | < | + | |
- | {{hold.cp_barcode}} | + | |
- | </ | + | |
</a> | </a> | ||
</ | </ | ||
- | </ | ||
- | 2. Below that, the grid column is defined: | + | < |
- | + | [cellTemplate]=" | |
- | < | + | |
- | < | + | |
- | [cellTemplate]=" | + | |
</ | </ | ||
</ | </ | ||
- | 3. The grid.component.ts file is modified to specify the alternate text that should print out: | + | 2. The eg-grid tag must also include |
+ | < | ||
+ | |||
+ | 3. The grid.component.ts file must include the ability to use GridCellTextGenerator: | ||
+ | |||
+ | < | ||
+ | |||
+ | and then inside the class: | ||
+ | |||
+ | < | ||
+ | |||
+ | 4. And then inside ngOnInit - the grid.component.ts file is modified to specify the alternate text that should print out: | ||
< | < | ||
this.cellTextGenerator = { | this.cellTextGenerator = { | ||
- | title: row => row.title, | + | title: row => row.title |
- | cp_barcode: row => (row.cp_barcode == null) ? '' | + | |
- | current_item: | + | |
- | requested_item: | + | |
- | ucard_barcode: | + | |
}; | }; | ||
</ | </ | ||
+ |
newdevs/code/grid-cell-text-generator.txt · Last modified: 2023/12/21 16:55 by tmccanna