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