formatter
See original GitHub issue| Software | Version(s) |
| ----------------- | ---------- | | Aurelia : “aurelia-bootstrap”: “^0.1.20”, “aurelia-bootstrapper”: “2.3.3”, au cli 1.3.1 systemjs | Aurelia-Slickgrid | “aurelia-slickgrid”: “2.20.1”,
| Operating System | Windows10 or WIndowsServer | Yarn v1.22.4 |
Context
While I have an easy solution using joins or lookups at database level or hard coded formaters. While not pressing need, I was wondering if there is anyway to to call a service thats holding json data with the the formatter, i.e.
this.appService.adjusters is the service that made a db call and reteived the list below.
hard coded call
const adj = [{ "ID": 1, "AdjusterName": "Bergen Risk Managers", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 0 },
{ "ID": 79, "AdjusterName": "Carol Benja", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 219 },
{ "ID": 77, "AdjusterName": "Donna Luciani", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 117 },
{ "ID": 10, "AdjusterName": "Fran Van Wagner", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 113 },
{ "ID": 76, "AdjusterName": "Irene Markel", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 114 },
{ "ID": 35, "AdjusterName": "Jane Scalzitti", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 112 },
{ "ID": 2, "AdjusterName": "Jennifer Dittemer", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 100 },
{ "ID": 75, "AdjusterName": "Jim Markel", "AdjusterPhone": null, "Active": "Y ", "Staff ID": null },
{ "ID": 3, "AdjusterName": "John Markel", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 101 },
{ "ID": 30, "AdjusterName": "Kathleen McGuire", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 106 },
{ "ID": 78, "AdjusterName": "Lori Shannon", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 118 },
{ "ID": 29, "AdjusterName": "Lynn McCorry", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 107 },
{ "ID": 17, "AdjusterName": "Michele Riabov", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 111 },
{ "ID": 13, "AdjusterName": "Robert Dittemer", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 108 },
{ "ID": 6, "AdjusterName": "Robert McGuire", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 102 },
{ "ID": 28, "AdjusterName": "Trisha McTigue", "AdjusterPhone": null, "Active": "Y ", "Staff ID": 109 }]
const myadjusterformatter = (row, cell, value, columnDef, dataContext) => {
let found = adj.find(f => f.ID === value);
let val
if (found === -1) {
val = 'Not available!';
} else val = found.AdjusterName
return val
}
{
id: 'AdjusterID',
name: 'Adjuster',
field: 'AdjusterID',
sortable: true,
filterable: true,
minWidth: 70,
formatter: myadjusterformatter
},
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Free Online HTML Formatter - FreeFormatter.com
This free online HTML formatter and validator lets you chose your indentation level and also lets you export to file.
Read more >Formatter (Java Platform SE 8 ) - Oracle Help Center
An interpreter for printf-style format strings. This class provides support for layout justification and alignment, common formats for numeric, string, ...
Read more >SD Memory Card Formatter - SD Association
Watch our video on how to use the SD Memory Card Formatter. SD Memory Card Formatter 5.0.2 for SD/SDHC/SDXC. The SD Memory Card...
Read more >JSON Formatter & Validator
The JSON Formatter & Validator beautifies and debugs JSON data with advanced formatting and validation algorithms.
Read more >Formatter definition and meaning | Collins English Dictionary
Formatter definition: a computer program used for formatting | Meaning, pronunciation, translations and examples.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thats the bad side of modern JS and arrow functions which let you forget how you used to do things earlier with bind/call 😉
I think issue (question) was resolved, so I’ll close the issue