Note that there are some explanatory texts on larger screens.

plurals
  1. PODelete command not firing datasource's destroy transport method
    primarykey
    data
    text
    <p>I have a destroy command defined in one of the columns for a Kendo Grid:</p> <pre><code>columns: [ { field: "Address", width: "200px" }, { field: "City" }, { field: "State", width: "40px" }, { field: "Zip", width: "60px" }, { field: "Active", width: "50px" }, { command: ["edit", "destroy"], title: "&amp;nbsp;", width: "210px" } ] </code></pre> <p>Editable is set to <strong>inline</strong> for the grid. Batch is set to true for the datasource.</p> <p>Editing and saving works fine (all models are sent in JSON format to SAVE method).</p> <p>But when I click on DELETE for one of the rows, it removes the row from the grid BUT it behaves just like I was saving all items. It calls the save method and sends every single row, except for the one I want to delete, in a JSON object.</p> <p>The question is: Why is it not calling the destroy method?</p> <p>Shouldn't it call the destroy method and send only the row being deleted?</p> <p>Datasource definition:</p> <pre><code>dataSource: { error : function (e) { CustomError(e); }, type : "json", transport: { read : { contentType: "application/json; charset=utf-8", type : "POST", url : "../Services/svcPerson_Address.asmx/Search", dataType : "json", cache : false, complete : function (e) { //alert(e); } }, update : { contentType: "application/json; charset=utf-8", type : "POST", url : "../Services/svcPerson_Address.asmx/Save", dataType : "json", cache : false, complete : function (e) { if (typeof (e.responseText) != "undefined") { var response = $.parseJSON(e.responseText); } } }, destroy : { contentType: "application/json; charset=utf-8", url : "../Services/svcPerson_Address.asmx/Delete", type : "POST", dataType : "json", cache : false, complete : function (e) { } }, create : { contentType: "application/json; charset=utf-8", type : "POST", url : "../Services/svcPerson_Address.asmx/Save", cache : false, complete : function (e) { if (typeof (e.responseText) != "undefined") { var response = $.parseJSON(e.responseText); } } }, parameterMap: function (options, operation) { if (operation !== "read" &amp;&amp; options.models) { return kendo.stringify({ models: options.models }); } options.PersonId = 0; if (viewModel.SelectedPreceptor != null) { if (viewModel.SelectedPreceptor.PersonId != "" &amp;&amp; viewModel.SelectedPreceptor.PersonId != null) { options.PersonId = viewModel.SelectedPreceptor.PersonId; } } return kendo.stringify(options); } }, </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload