Hi,
I have 2 issues here :
ISSUE-1
I want to use the IgTree on an load-on-demand way. At the same time I want to create dynamic nodes. Basically my tree is a kind where users can create Child folders at any parent level. Dynamic folders can be from the context menu option of a any node. I could not find any such example of its kind.
ISSUE-2
I am using XML with hierarchical structure using client side binding. But I found the following limitation on igTree. (http://help.infragistics.com/Help/NetAdvantage/jQuery/2011.2/CLR4.0/html/igTree_Known_Limitations.html)
Could you please help me with ISSUE-1 and let me know when you will be providing the support for ISSUE-2
Thanks,
Anirban
Hi Anirban,
Is ISSUE-1 anything close to the scenario described here: http://forums.infragistics.com/forums/t/64875.aspx ? Note that as I have already described in that forum thread, add/delete nodes is not supported directly in the tree, but you can be doing it in the data source.
About ISSUE-2. Loading XML directly by the browser and using it as a data source is not a very common scenario as it is not consistently (if at all) supported by all browsers. Some browsers like IE throw security warnings, other directly block it. That is the reason for us to have better support for XML loaded on the server and delivered to the client in the form of JSON (this is the MVC XML scenarion sampled here: http://samples.infragistics.com/jquery/tree/binding-in-asp-net-mvc).
Is it a must for your purpose to have XML directly loaded on the client? XMLs are usually large and this is slow even in terms of loading time.
Looking forward to your reply!
Hi Konstantin,
Thanks for your reply. Here is my reply to your answers :
ISSUE-1 : Before I even add a node, how do I get to show the nodes in the tree when I do not know the level. The tree can have upto nth levvel. In that case what will be my approach to show the data. In all the examples shown, I see the child level is always known. In the example discussed http://forums.infragistics.com/forums/t/64875.aspx, what if I have a node like this :
Now to show the data on on demand basis, what will be my approach to create the nodes on an on-demand basis ?
I am now returning Json data back to the client. i.e. initially I load Node 100, Node 200 & Node 300. Now when user expands Node 100, I need to go and fetch the nodes Node001, Node002 & Node003. Again when user expands Node 003, since it has child nodes, I need to fetch Node003_1 and so on. Here, I do not know upto what level this can go.
Please note, the structure, I am returning on to the client, the parent node has a property where it always knows whether it has a child node or not.
I understand your point how to add Nodes to the level but that is coming at a later point.
Hope I am able to put my scenario. Please let me know your thoughts on this.
Hi there,
This is achievable by modifying the controller action that returns JSON data to the tree. Here is an example of a controller action which uses the built-in data retrieval method of the jQuery tree model. However you can construct that JSON yourself and return it from the action. All you need to do in order for the tree node to have children is to set an empty collection for the ChildDataProperty. So if the ChildDataProperty of the current level bindings is Children, then your JSON would look like:
{ Text: 'text', Value: 'value', Children: [] }
This would create a tree node with expand indicator and when the user tries to expand it, it would call the controller action again with the parameters for the new node that you're expanding.
Does this sound like what you are looking for?
Thank you for your reply. If there any documentation available for this ?
I found something very similar which I would like to share so that the same can be incorporated in the igTree . http://wwwendt.de/tech/dynatree/doc/samples.html
Thanks that helps.
Hi again,
As I have already pointed out the add/delete node functionality is not yet supported by the igTree. However you can still extend the existing functionality and make some version of add/delete if this is essential to your application.
The documentation for the igTree is located here: http://help.infragistics.com/NetAdvantage/jQuery/Current/CLR4.0
To explain the request parameters when data is requested:
Consider the following example from the samples page:http://samples.infragistics.local/jquery/tree/TreeGetData?controller=LoadOnDemand&sampleid=90d937ec-1b9e-44a8-ab0a-83de0fc8be31&path=ProductCategoryID:1/@ProductSubcategories&binding=textKey:Name,primaryKey:ProductSubcategoryID,childDataProperty:Products&depth=0&_=1323938304689
The first parameter is the path which contains of the primary key of the currently being expanded node and the child data field that we're requesting. They can be split by '/' and the first part of the string can be split by ':' in order to get the name/value of the primary key. The @Attribute at the second part of the string is the field we're looking for in the table.
In this example you can see the path to the node, including the property name of where children are located, the binding and the depth at which the node is located. The ProductCategoryID is the primary key and 1 is its value. ProductSubcategories is the name of the field to be extracted for child data, so the Linq query produced is SELECT ProductSubcategories FROM Context WHERE ProductCategoryID == 1. ProductSubcategories are needed in the request string because the table may contain other child level data references such as ProductInventories and we should be able to distinguish between them.
I hope this helps!