JavaScript
$(document).ready(function () {
var localData = [
{ id: 1, Name: "aeSolutions", Type: "Enterprise", Warning: null, IsEdited: false, parentId: null },
{ id: 2, Name: "Safety Lifecycle Management", Type: "Division", Warning: null, IsEdited: false, parentId: 1 },
{ id: 3, Name: "North America", Type: "Region", Warning: null, IsEdited: false, parentId: 2 },
{ id: 4, Name: "AK", Type: "Area", Warning: null, IsEdited: false, parentId: 3 },
{ id: 7, Name: "Anchorage Faility 1", Type: "Facility", Warning: null, IsEdited: false, parentId: 4 },
{ id: 8, Name: "Anchorage Faility 2", Type: "Facility", Warning: null, IsEdited: false, parentId: 4 },
{ id: 5, Name: "SC", Type: "Area", Warning: null, IsEdited: false, parentId: 3 },
{ id: 10, Name: "Greenville A18", Type: "Facility", Warning: null, IsEdited: false, parentId: 5 },
{ id: 11, Name: "Greenville B17", Type: "Facility", Warning: null, IsEdited: false, parentId: 5 },
{ id: 6, Name: "LA", Type: "Area", Warning: null, IsEdited: false, parentId: 3 },
{ id: 9, Name: "Baton Rouge", Type: "Facility", Warning: null, IsEdited: false, parentId: 6 },
];
var dataSource = new kendo.data.TreeListDataSource({
transport: {
read: function(options) {
options.success(localData);
console.log('read');
},
update: function(options) {
for(var i=0; i<localData.length; i++){
if(localData[i].id == options.data.models[0].id){
localData[i].Name = options.data.models[0].Name;
localData[i].IsEdited = true;
console.log('set name to: ' + options.data.models[0].Name);
console.log('localData',localData);
}
...