feat: ✨ Passa il valore a `valueModifier`
This commit is contained in:
parent
23f1f9e82f
commit
f7a7bcf0c4
|
@ -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 : '';
|
||||||
|
|
Loading…
Reference in New Issue