Hi.
I'm checking out how much of an effort it is to upgrade from our current UltraWebTree 11.1 to WebDataTree 12.2.
The challenge is that the existing code uses ReadXmlText to bind/load data into the control. I do not see a similar method in WebDataTree.
The current XML format we use is not tied to a schema; so what would be the easiest way to use this data format in the WebDataTree control.
Code snippet of current implementation...
XmlTextReader resultReader = new XmlTextReader(XMLString,XmlNodeType.Document,null); ultraWebTree.ReadXmlText(resultReader,true,false);
The XMLString is something like... (I got one of the longest I could!)
Quote 189 Type of Business Class of Business Objects of Interest Object Mame 564 Joint Membership 0 Co-Assured 0 Member David Lloyd 6079811 Company name 60811 Contributors 0 Contract Rules 13 Contract for Object 1 24 Rule Rule 1 Clauses PPP111 CLause 1 for Object 1 82 CLause 2 for Object 1 83 Rule 2 for Object 1 Clauses PPP222 CLause 1 for Object 1 82 CLause 2 for Object 1 83 Payment Amount Assessment 1 Member Name 0 David LLoyd
Thanks Maya.
I guess the confusion can be attributed to the fact that the Initialize property can be used as an event, but there isnt an example for it.
something like...
Initialize="xwdTree_Init"
and a function like...
function xwdTree_Init(sender, eventArgs)
function
xwdTree_Init(sender, eventArgs)
I'm basically trying to get all nodes in the Initialize event and check if I can set the cssClass from the style attribute in the xml.
Any suggestions for this?
Hello Ajeesh ,
The “sender” will always be the WebDataTree object since that will be the object that raises the event.
The eventArgs depend on the specific event.
For example the NodeExpanded event will take an event argument of type DataTreeNodeEventArgs. If you open that object’s members:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0/?page=WebDataTree~Infragistics.Web.UI.DataTreeNodeEventArgs_members.html
You’ll see what methods you have available. In this case you have only getNode() which will return the related node object for the event.
Other events take other types of event arguments for example the SelectionChanging event:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0/?page=Infragistics4.Web.v12.2~Infragistics.Web.UI.NavigationControls.DataTreeClientEvents~SelectionChanging.html
Takes an eventArgument of type DataTreeSelectionEventArgs:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0/?page=WebDataTree~Infragistics.Web.UI.DataTreeSelectionEventArgs_members.html
Which has other available methods like the getNewSelectedNodes() method.
To check exactly what type of event arguments each event takes you can open the event specification from the list:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0/?page=Infragistics4.Web.v12.2~Infragistics.Web.UI.NavigationControls.DataTreeClientEvents_members.html
In it there’s a code example and in it at the top you’ll find a comment that describes what the sender and event arguments are. Once you find the type of the argument you can search the documentation and find the members of that type.
Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://ko.infragistics.com/support
We had been using UltraWebTree.ReadXmlText() to populate the tree view control, by passing the XML containing the node text, value and style elements, something like…
<Nodes>
<Node>
<Text>Joint</Text>
<Tag>0</Tag>
<Style>
<ForeColor>#FFFC0033</ForeColor>
</Style>
<Nodes />
</Node>
</Nodes>
We are finding it difficult to achieve the same styling functionality in the WebDataTree, with a source xml something like the below…
<Node Text="Proposal" Tag="153">
<Node Text="Entry1" Tag="">
<Node Text="Entry1-1" Tag="">
<Node Text="Entry1-1-1" Tag="">
<Node Text="TestName" Tag="462">
<Node Text="Joint" Tag="0" Style="red">></Node>
<Node Text="Co" Tag="0"></Node>
<Node Text="Member" Tag=""></Node>
<Node Text="Mortgage" Tag="0" Style="red">></Node>
One if the solutions we can think of now is use the style attribute from the xml in a JS function to set the cssclass attribute.
One of the key challenges we are now facing in handling this in the client side JS function is that there isnt much info online about arguments of event-handlers
http://help.infragistics.com/NetAdvantage/ASPNET/2012.2/CLR4.0/?page=WebDataTree~Infragistics.Web.UI_namespace.html
These 2 links help me get a list of the client-side event names, but not much information about the arguments of the event-handlers.
For instance, consider the below JS function which gets called on the NodeExpanded client event…
function WebDataTree1_NodeExpanded(sender, eventArgs)
I could not find any info on what functions and properties can be used for the sender or the eventArgs arguments, like…
eventArgs.getNode().get_childrenCount()
Can you share some link where we can get these details?
This will be useful when I try to implement an event for which you haven’t shared samples, like Initialize. I need to get all nodes in this function.
Hello Ajeesh,
Thank you for posting in our forum.
There’s no similar method for the WebDataTree. The WebDataTree doesn’t have any presets like the UltraWebTree had.For the UltraWebTree loading the xml definition in this manner was possible since it supported the saving and creating of presents in that specific xml format.
For the WebDataTree you could use a xml data source to populate the nodes however it will have to be in a different format than what you currently have in your xml file.There’s an example and explanation on how you can set up an xml data source for the WebDataTree here: http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebDataTree_Binding_WebDataTree_to_an_Xml_Data_Source.html
Let me know if you have any questions or concerns.