[CLOSED] adding handler listener in codebehind

  1. #1

    [CLOSED] adding handler listener in codebehind

    I am doing an async treepanel until I get to the below code to add my leafs.

    My basic problem is that the handler here is passing a dom element of TabDetails which is my tabpanel but it is lacking all the methods to call in this instance. so I can't do a .getComponent or an .add on the tabpanel.

    How do I need to write this when creating the node from my webservice?


    TreeNode Node = new TreeNode();
    Node.Text = dr["NAME"].ToString();
    Node.Leaf = true;
    Node.NodeID = node + "_N_" + dr["NAME"].ToString();
    Node.Listeners.DblClick.Handler = "addTab(#{TabDetails},'" + dr["PROJECTID"].ToString() + "','" + dr["NAME"].ToString() + "','projectDetails?id=" + dr["PROJECTID"].ToString() + "')";
    nodes.Add(Node);
  2. #2

    RE: adding handler listener in codebehind

    Footnote:

    I have also tried passing the tabpanels ID directly and then doing Ext.get(tabPanelID) but this results in the same dom that doesn't contain all the methods still.



  3. #3

    RE: adding handler listener in codebehind

    Hi Ashton,

    Your code seems fine. Can you post a full sample?


    Using #{TabDetails} should return an instance of the TabPanel object as an argument to the JavaScript function.


    I think the issue might be in your .addTab function. Please post your .addTab function.


    Geoffrey McGill
    Founder
  4. #4

    RE: adding handler listener in codebehind

    Hi,

    I just noticed that you are returning from a WebService...


    If this is the case, then using #{TabDetails} will not work. The WebService is unaware of the other Components on the Page.


    You'll have to hardcode the .ClientID of the TabDetails Component.


    As well, if you pass the .ClientID of TabDetails as a string to your .addTab function, you must use Ext.getCmp, instead of Ext.get.


    If you pass the .ClientID as an instance variable (without quotes), then you do not require Ext.getCmp.


    Hope this helps.


    Geoffrey McGill
    Founder
  5. #5

    RE: adding handler listener in codebehind

    Geoff,

    Thanks your right. getCmp will fix my issue if I pass the clientID to the add tab function. I was using the wrong one.

Similar Threads

  1. Replies: 2
    Last Post: Jul 16, 2010, 11:59 AM
  2. rowDblClick listener handler
    By [WP]joju in forum 1.x Help
    Replies: 2
    Last Post: Mar 03, 2010, 9:19 AM
  3. Replies: 4
    Last Post: Aug 10, 2009, 4:00 PM
  4. Assign GetRowClass-Handler in codebehind
    By pschojer in forum Bugs
    Replies: 1
    Last Post: Jul 13, 2009, 1:40 PM
  5. [CLOSED] Changing Listener Handler from Code Behind
    By Immobilmente in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 16, 2009, 11:23 AM

Posting Permissions