PDA

View Full Version : TreeNode Javascript Events



markrobotnik
Apr 05, 2012, 4:30 AM
Hi,

I was starting to develop a demo for work using version 1.3 but have since halted and changed to version 2.0 due to charts. The thing is that my demo used a tree as a menu system and each node had its own click and rightclick function.

Listeners have been removed from nodes. How do I add event listeners to nodes.


Example (In VB .NET):


'New Area
Dim areaNodeAdd As New Node()
areaNodeAdd.Text = "[Add New Entity]"
areaNodeAdd.Icon = IconBe.Icon(IconType.Area, True)
areaNodeAdd.Listeners.ContextMenu.Handler = "javascript:#{DirectMethods}.LaunchNew_WindowAreaPr operties();"
areaNodeAdd.Listeners.Click.Handler = "javascript:#{DirectMethods}.LaunchNew_WindowAreaPr operties();"
root.Children.Add(areaNodeAdd)

Daniil
Apr 05, 2012, 3:06 PM
Hi,

A tree node doesn't present its UI in Ext.NET v2, it's rather a Store record.

So, please use the TreePanel ItemClick and ItemContextMenu events.

markrobotnik
Apr 18, 2012, 4:27 AM
Hi,

A tree node doesn't present its UI in Ext.NET v2, it's rather a Store record.

So, please use the TreePanel ItemClick and ItemContextMenu events.

I can understand that you wish to change a TreePanel to fundamentaly behave like a GridPanel or DataView in relation to its store, however this is dissapointing because a TreeNode no longer behaves like a ListItem in relation to a name/value pair which makes it difficult to use a TreePanel like a ComboBox for isntance.

For example if I have a list of people I wish to display the Person.Name but I wish the value to be Person.PersonId and as far as I can tell there is no place in a treenode to store the value.

Daniil
Apr 18, 2012, 10:08 AM
You can store any additional info via Node CustomAttributes.