feat: Passa il valore a `valueModifier`

This commit is contained in:
Maicol Battistini 2022-01-27 10:08:23 +01:00
parent 23f1f9e82f
commit f7a7bcf0c4
No known key found for this signature in database
GPG Key ID: 4FDB0F87CDB1D34A
1 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ export type ColumnT = {
id?: string id?: string
title: string title: string
type?: 'checkbox' | 'numeric' type?: 'checkbox' | 'numeric'
valueModifier?: (instance: IModel, property: string) => any valueModifier?: (value: any, field: string, model: IModel) => any
}; };
export type SectionT = { export type SectionT = {
heading?: string heading?: string
@ -433,7 +433,7 @@ export class RecordsPage extends Page {
} }
if (typeof column === 'object' && column.valueModifier) { if (typeof column === 'object' && column.valueModifier) {
value = column.valueModifier(model, field); value = column.valueModifier(value, field, model);
} }
return (value || raw) ? value : ''; return (value || raw) ? value : '';