Hi, I'm trying to UPDATE and DELETE some rows from the spreadheet control, with datasource binding.
I've a custom defined button with save function:
$("#savebuttons").on('click', '#Save', function () {
if (!$(this).hasClass("k-state-disabled")) {
getDataSource().sync();
}
});
The datasource looks like this:
.DataSource<Siergy.BackOffice.Models.Management.ProjectElementViewModel>
(ds => ds
.Ajax()
.Batch(true)
.Read(read => read.Action("ProjectElementsSpreadsheet_Read", "ProjectsManagement"))
.Update(update => update.Action("ProjectElementsSpreadsheet_Update", "ProjectsManagement"))
.Create(create => create.Action("ProjectElementsSpreadsheet_Create", "ProjectsManagement"))
.Destroy(destroy => destroy.Action("ProjectElementsSpreadsheet_Destroy", "ProjectsManagement"))
.Events(e => e.Change("onChange"))
.Model(m =>
{
m.Id(p => p.IdElement);
})
);
All is working well to update rows, but destroy action never fires in the server, how can I get this working?
From DataSource documentation:
sync
Saves any data item changes.
The sync method will request the remote service if:
the transport.create option is set and the data source contains new data items
the transport.destroy option is set and data items have been removed from the data source
the transport.update option is set and the data source contains updated data items
Is it valid for spreadsheet datasources too?
Best Regards