1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

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

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 : '';