This is a migrated thread and some comments may be shown as answers.

transport destroy method delete issue

2 Answers 85 Views
Hierarchical Data Source
This is a migrated thread and some comments may be shown as answers.
ringo
Top achievements
Rank 1
ringo asked on 20 Mar 2015, 11:20 PM
Hierarchical Data Source
When the transport destroy is called the method is always GET and not delete as defined.
What am I doing wrong here ?

So below for the destroy code:


destroy: function (options) {
$.ajax({
type: 'delete',
url: "http://localhost:81/public/index.php/treepage/" + options.data.id,
dataType: "jsonp",
success: function(result) {
// notify the data source that the request succeeded
console.log("destroy succes");
},
error: function(result) {
// notify the data source that the request failed
console.log("destroy error", result);
options.error(result);
},
beforeSend: function() {
console.log("treemodel - beforesend - destroy");
}
})
.done (function(data) { console.log("done destroy - data:", data) });
}

2 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 24 Mar 2015, 05:36 PM
Hi Ringo,

JSONP requests can be only of type "GET". It is technically not possible to make a "DELETE" JSONP request.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
ringo
Top achievements
Rank 1
answered on 25 Mar 2015, 03:18 PM
Thank you I switched to json.
Tags
Hierarchical Data Source
Asked by
ringo
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
ringo
Top achievements
Rank 1
Share this question
or