Treeview - remote - update

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

    Posted 30 Mar 2015 Link to this post

    When the structure is like:

    - folder (treepage_id=1)
         - node 2 (treepage_id=2)
         - node 3 (treepage_id=3)

    Selecting node 2 will trigger an update and is send as jsonp like:
    treepage/update?callback=callback&treepage_id=1&text=node 2& etc..
    The treepage_id has a value of 1 which should be 2

    The question is: why isn't is sending with the correct treepage_id value of 2 ?


    Same goes when selecting node 3:
    treepage/update?callback=callback&treepage_id=1&text=node 3& etc..

    When the 'folder' with treepage_id = 1 is updated it will send itself and the nodes 2 and 3 as items without issues and all the correct treepage_id's.



    Schema looks like:
    =====================
    schema: {
    model: {
    id: "treepage_id",
    fields: {
    treepage_id: { editable: false },
    user_id: { type: "string"},
    text: { type: "string" },
    parent_id: { type: "int" },
    index: { type: "int" },
    selected: { type: "boolean" },
    expanded: { type: "boolean" },
    spriteCssClass: { type: "string" }
    },
    hasChildren: "hasChildren"
    }
    }

    transport:
    ===========

    this.datasource = new kendo.data.HierarchicalDataSource({
    autoSync: true,
    batchmode: false,

    transport:
    {
    read:
    {
    url: serviceRoot + "/treepage",
    contentType: "application/json",
    dataType: "jsonp", // "jsonp" is required for cross-domain requests will always use type get; use "json" for same-domain requests
    jsonpCallback: "callback",
    beforeSend: function() {
    console.log("treemodel - beforesend - read");
    }

    },

    update:
    {
    url: serviceRoot + "/treepage/update",
    contentType: "application/json",
    dataType: "jsonp",
    jsonpCallback: "callback",
    beforeSend: function() {
    console.log("treemodel - beforesend - update");
    }

    },

    create:
    {
    url: serviceRoot + "/treepage/create",
    dataType: "jsonp",
    contentType: "application/json",
    jsonpCallback: "callback",
    beforeSend: function() {
    console.log("treemodel - beforesend - create");
    }
    },//)
    //.done (function(data) { console.log("done create - data:, data") })

    destroy:
    {
    url: serviceRoot + "/treepage/delete",
    dataType: "jsonp",
    contentType: "application/json",
    jsonpCallback: "callback",
    beforeSend: function() {
    console.log("treemodel - beforesend - destroy");
    }
    }















  2. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 31 Mar 2015 Link to this post

    Hi Ringo,

    I just replied to your support ticket which refers to this post. At this point I am not sure what happens in your setup - we need to run it on our side in order to help you further. Please isolate your case in a runnable sample and post it here (or in the support ticket, if you find it more convenient). Thank you in advance.

    Regards,
    Petyo
    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
Back to Top