Problem :
Destroy doesn't go to the controller, What am i doing wrong?
Read function works fine.
Grid :
<kendo-datasource name=
"dateSource2"
type=
"DataSourceTagHelperType.Ajax"
server-operation=
"false"
>
<transport>
<read url=
"/Begroting/GetBegrotingWijzigingen?filterElement=2-9"
/>
<destroy url=
"/Begroting/RemoveBegrotingWijziging"
/>
</transport>
<schema>
<model id=
"Id"
>
</model>
</schema>
</kendo-datasource>
<kendo-grid name=
"grid2"
datasource-id=
"dateSource2"
>
<groupable enabled=
"false"
/>
<sortable enabled=
"true"
/>
<scrollable enabled=
"true"
/>
<filterable enabled=
"true"
/>
<pageable button-count=
"5"
refresh=
"true"
page-sizes=
"new int[] { 5, 10, 20, 50, 100 }"
>
</pageable>
<columns>
<column field=
"Datum"
title=
"Datum"
/>
<column field=
"Afdeling"
title=
"Afdeling"
/>
<column field=
"Combinatie"
title=
"Combinatie"
/>
<column field=
"Bedrag"
title=
"Bedrag"
/>
<column field=
"Toelichting"
title=
"Toelichting"
/>
<column>
<commands>
<column-command text=
"Delete"
name=
"destroy"
></column-command>
</commands>
</column>
</columns>
</kendo-grid>
Controller :
[HttpPost]
public
IActionResult RemoveBegrotingWijziging([DataSourceRequest] DataSourceRequest request, BegrotingRecord begrotingRecord)
{
if
(!begrotingRecord.Naarcoda)
{
_rW.BegrotingRepository.RemoveBegrotingRecord(begrotingRecord.Id);
}
return
Json(
"OK"
);
}