[CLOSED] [1.0] Doesn't TreePanel support Click event?

  1. #1

    [CLOSED] [1.0] Doesn't TreePanel support Click event?

    Hi,

    I'm studying coolite 1.0. Glad to know control can be created from code-behind, and there are some examples online.

    What I want to do is using a treepanel and a tabpanel to accomplish the system functions navigation. As to the detail, when clicking the treenode(leaf), adding a new tab in the tabpanel and autoload the page. But I found the new page can not be opened in the tabpanel control, it is opened in the window directly. I debug the code and found that the click event was not executed at all. What I want to know is whether treepanel support click event. If supported, what's wrong with my code. The following is the code:
    <West Collapsible="true" Split="true" MaxWidth="200px">
            <ext:TreePanel ID="tpnNavigator" runat="server" AutoHeight="True" RootVisible="False" Width="200px" Icon="ApplicationViewList">
                   <DirectEvents>
                         <Click OnEvent="tpnNavigator_Click">
                               <ExtraParams>
                                      <ext:Parameter Name="paraFunID" Value="node.id" Mode="Raw" />
                               </ExtraParams>
                         </Click>
                   </DirectEvents>
            </ext:TreePanel>
    </West>
        protected void tpnNavigator_Click(object sender, DirectEventArgs e)
        {
            //string strFunID = tpnNavigator.ActiveTab.ID;   SEEMS CANN'T GET THE RIGHT VALUE!!!
            string strFunID = e.ExtraParams["paraFunID"].ToString();
            bool Existed = false;
            //tpList is the ID of the tabpanel control
            foreach (Ext.Net.Component li in tpList.Items)
            {
                if (li.ID == strFunID)
                {
                    Existed = true;
                    break;
                }
            }
            if (Existed)
            {
                tpList.SetActiveTab(strFunID);
            }
            else
            {
                SysFunctions objFun = SysFunctions.SelectByFunID(strFunID);
                Ext.Net.Panel pnl = new Ext.Net.Panel();
                pnl.ID = "TAB_" + strFunID;
                pnl.Title = objFun.FunName;
                pnl.AutoLoad.Url = objFun.FunURL;
                pnl.AutoLoad.Mode = LoadMode.IFrame;
                pnl.Render(tpList, RenderMode.AddTo);
                //pnl.AddTo(tpList);
                tpList.SetActiveTab(strFunID);
            }
        }
    Please check the code above. THANKS A LOT.

  2. #2

    RE: [CLOSED] [1.0] Doesn't TreePanel support Click event?

    Hi! It's hard to tell from your code example what is exactly going wrong. Here are some tips that can help others debug your issue easier.


    1. Run in debug mode and put a breakpoint in the event handler. Is it breaking?2. Create a simple code example that anyone can just copy and paste into their project and run to reproduce the problem
    3. It seems like you are setting the ID of the new panel to be the same as the treenode. IDs should be unique.


    I have a simple layout in my application where on a treenode click, I add a new tab. It works fine in version 1.0.
  3. #3

    RE: [CLOSED] [1.0] Doesn't TreePanel support Click event?

    Hi, jchau.

    Thanks for your tips. Actually, I put a break point at the first code-line in the tpnNavigator_Click event. In the debug mode, it is not breaking. That's just what I wondering.

    By the way, can you show me your code for troubleshooting? You can put your code here or send me an email. (santon_lee@163.com)

    Thank you very much.

    Santon Lee.
    -----------------
  4. #4

    RE: [CLOSED] [1.0] Doesn't TreePanel support Click event?







    I have solved this problem. The reason why treenode_click event is not triggered is due to the treenode.Href property. I set value for the treenode.Href property, so when clicking the treenode, the new page is opened in the current window direct, NOT trigger the treenode_click event.

    This topic can be marked as '[CLOSED]'. Thanks.






Similar Threads

  1. Forums doesn't support unicode character
    By anhnt in forum Open Discussions
    Replies: 1
    Last Post: Jun 22, 2012, 6:37 PM
  2. Replies: 1
    Last Post: Mar 29, 2012, 9:52 AM
  3. Treepanel click event
    By Mr.Techno in forum 1.x Help
    Replies: 0
    Last Post: Sep 21, 2011, 5:28 AM
  4. Replies: 4
    Last Post: Feb 09, 2010, 1:21 AM
  5. Object doesn't support this property or method
    By Tbaseflug in forum 1.x Help
    Replies: 8
    Last Post: Aug 18, 2009, 12:10 PM

Posting Permissions