[CLOSED] TreePanel itemClick DirectEvent
I have created a TreePanel with several nodes in behindCode. Based on other threads I added a CustomAttribute to the node and want to access the info when the item is clicked.
How can I access it?
How can I add a second configItem named - "Action"?
Code:
private void BuildTreePanel ()
{
Ext.Net.TreePanel YearPanel = new Ext.Net.TreePanel();
YearPanel.Title = "Some Year";
YearPanel.Icon = Icon.Calendar;
YearPanel.BodyPadding = 5;
YearPanel.RootVisible = false;
YearPanel.DirectEvents.ItemClick.Event += OverviewItemClicked;
Ext.Net.Node root = new Ext.Net.Node();
root.NodeId= "root";
root.Expanded = true;
YearPanel.Root.Add(root);
for(yeardt = 2005; yeardt <= 2012; yeardt ++)
{
Ext.Net.Node yearNode = new Ext.Net.Node();
yearNode.Text = yeardt.ToString();
yearNode.Icon = Icon.Calendar;
yearNode.CustomAttributes.Add(new ConfigItem {Name = "Year", Value = yeardt, Mode = ParameterMode.Value});
root.children.Add(yearNode);
}
....
//Additional code that adds the tree panel to the page and other stuff.
}
protected void OverviewItemClicked(object sender, DirectEventArgs e)
{
// Add code here because of the item clicked
}