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) });
}
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) });
}