transport destroy method delete issue

3 posts, 0 answers
  1. ringo
    ringo avatar
    9 posts
    Member since:
    Jun 2013

    Posted 20 Mar 2015 Link to this post

    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. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 24 Mar 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. ringo
    ringo avatar
    9 posts
    Member since:
    Jun 2013

    Posted 25 Mar 2015 in reply to Alexander Valchev Link to this post

    Thank you I switched to json.
Back to Top