I have an issue with ng2-smart-table, which I fill with an empty localdatasource.
I have a Date column, which use a custom editor :
dateInscription: {
title: 'Date',
filter:false,
type: 'string',
valuePrepareFunction: (cell, row) => {
return `${new Date(cell).toLocaleDateString()}`;
},
editor: {
type: 'custom',
component: DateRenderComponent,
},
}
The editor extends DefaultEditor and of course open a datepicker (p-calendar). When the user select a date, the cell value is updated using :
onSelect(event)
{
this.cell.newValue = this.value;
}
The event is well fired. This work in new rows... What could be wrong ?
Once the row is created, I want to edit it, and this don't work. When I click the "save" command, the old value stay (note that other simple text columns are updated).
I can see the valuePrepareFunction beeing called after clicking "save", with the old cell value.
I've double check than the onSelect event is setting the good value in cell.newValue
Did someone already got this issue ? What was the solution ? Thanks !