[CLOSED] TreePanel itemClick DirectEvent

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [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"?

    
       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
       }
    Last edited by Daniil; Oct 26, 2012 at 4:53 AM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] TreePanel DirectEvent BehindCode
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 17, 2012, 6:30 PM
  2. Replies: 1
    Last Post: Jun 09, 2011, 7:04 PM
  3. [CLOSED] Send all treepanel nodes to directevent as extraparam
    By KorsG in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 09, 2011, 4:57 PM
  4. [CLOSED] TreePanel DirectEvent CheckChange
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 10, 2010, 4:44 AM
  5. [CLOSED] [1.0] TreePanel add node at DirectEvent
    By methode in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 08, 2009, 1:56 PM

Posting Permissions