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

Treeview - remote - update

1 Answer 70 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
ringo
Top achievements
Rank 1
ringo asked on 30 Mar 2015, 01:23 PM
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");
}
}















1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 31 Mar 2015, 02:34 PM
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!
 
Tags
TreeView
Asked by
ringo
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or