0
votes

I have a Kendo TreeView in which the parent nodes and children are all gotten at the same time.

Previously I was having the separate calls of which unless a Parent node was expanded, it did not call a query and pull that data into the parent node as children

Now that I have my data pulled all at once, I want to be able to do all sorts of CRUD operation in which if a node is created, deleted, sort order changed, then on Button click I want to send in all the data.

PROBLEM:

I noticed that in doing a console.log(mydatasource.data()); that I am seeing EMPTY children items.

Seems that if I expand ( or expand and collapse) THEN I get the children items to show up in chrome dev tools output

This is certainly a huge problem as I'm trying to send in the complete data and then run CRUD operations on all the data from essentially 3 database tables....

Why and how is this happening?

// show my data in chrome browser that is getting sent to mvc method
console.log(homogeneous.data());  

Kendo TreeView

var homogeneous = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: serviceRoot + "/GetReportGroupAssignments", 
                dataType: "json" 
            }
        },

        schema: {
            model: {
                id: "Id" 
                ,
                children: "items",
                hasChildren: "Id"
            }
        }
    });

var treeview = $("#treeview").kendoTreeView({
            expanded: true,
            dragAndDrop: true,
            select: onSelect,
            dataSource: homogeneous,
            dataTextField: "ReportGroupName" 
            ,
            template: kendo.template($("#treeview-template").html()) //,
        }).data("kendoTreeView");
1

1 Answers

1
votes