I have a grid that shows all uploaded documents. I want to be able to delete those documents. When I click the delete button I would like a confirmation to popup and then the delete to fire to the server. I have done this before and copied my code from another project. However it is not working and I can't seem to figure out why.
var viewModel = new kendo.observable({
rfpId: $('#RFPId').val(),
isContinueEnabled: false,
documentsDataSource: new kendo.data.DataSource({
transport: {
read: {
url: "/RFP/GetDocuments",
data: { id: $('#RFPId').val() },
dataType: "json"
},
destroy: {
url: "/RFP/DeleteDocument",
dataType: "json"
},
schema: {
model: {
fields: {
Id: { editable: false, nullable: true},
Name: { type: "string" },
CreateDate: { type: "date" }
}
}
}
},
pageSize: 10,
serverPaging: false,
serverFiltering: false,
serverSorting: false
}),
reloadDocuments: function () {
this.get("documentsDataSource").read();
}
});
$("#GridUploadedDocuments").kendoGrid({
dataSource: viewModel.get("documentsDataSource"),
filterable: false,
sortable: false,
pageable: true,
scrollable: false,
columns: [
{ field: "Name", title: "Name"},
{ field: "CreateDate", title: "Date/Time", width: "150px", template: "#= kendo.toString(kendo.parseDate(CreateDate, 'MM-dd-yyyy hh:mm tt'), 'MM-dd-yyyy hh:mm tt') #" },
{ command: ["destroy"], title: " ", width: "120px" }],
editable: {
update: false,
destroy: true,
mode: "inline"
}
});
I have no errors in Firebugs. I have Fiddler open and no attempt to hit the server is being made. I am sure it is a simple error.