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

Adding Child Nodes Dynamically

2 Answers 190 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 18 Apr 2013, 07:09 PM
Hey there.

I've got a basic TreeView working. I'm using remote json data for the initial TreeView. What I need to do, is have the children added to the tree when the user clicks on the parent node. I'll need to make another call to the server for this next set of data since the node clicked contains a property I need in order to construct data property  required for the next rest call.

Do you have any example of how this is done using binding to remote data?

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Charles
Top achievements
Rank 1
answered on 19 Apr 2013, 02:23 PM
I've solved some of this issue using the REST version of the URL as shown here: 

transport: {
    read: {
      url: function(options) {
      return kendo.format("http://services.odata.org/Northwind/Northwind.svc/Products({0})/Order_Details", options.ProductID);
      }
    }
  },
Now my issue is that I need to know the values of the parent(s) options.ProductID's in order to make this work. Is there a way to get this value from the expanded node? For example if I have this kind of structure:

/Category
/Category/Item
/Category/Item/Category

When I click on that last node to expand it, I need to get the full path (if that makes sense). So I would want Category/Item/ or something like that.

Thanks
0
Keith
Top achievements
Rank 2
Iron
Veteran
answered on 05 Nov 2013, 07:23 PM
Did you ever figure this out?
Tags
TreeView
Asked by
Charles
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Keith
Top achievements
Rank 2
Iron
Veteran
Share this question
or