单击 TreePanel 节点时执行操作

Do action when clicking in a TreePanel node

当前状态: 我有一个 TreePanel 和一个 GridPanel,其中前者从数据库加载类别和第二篇文章。 使用 Visual Studio 2010、Ext.Net 2.5 和 C#

问题: 我无法做到这一点,所以当您单击一个类别(TreePanel 节点)时,它会执行特定功能(在我的例子中,我想根据单击的类别填充文章,因为节点具有 ID)

我尝试使用 TreeNodeMouseClickEventArgs 但它没有用(实际上它创建了一个什么都没有的 class),而且由于我刚开始使用这个软件(和语言),我被卡住了.

非常感谢。

编辑 我尝试的最后一个代码是 from MS website.

找到方法了,分享一下:

在客户端 添加树面板后,添加一个DirectEvents

<DirectEvents>
    //Calls a function when doing click on a node
    <ItemClick OnEvent="yourFunction">
        <ExtraParams>
            //Loads the nodeID
            <ext:Parameter Name="NodeID" Value="record.data.id" Mode="Raw"/>
        </ExtraParams>
    </ItemClick>
</DirectEvents>

在服务器端

public void yourFunction(object sender, DirectEventArgs e)
{
    //Ask the nodeID
    string id = e.ExtraParams["NodeID"];
    //Your function goes below
}