最近在用一个树形控件dhtmlXTree,但是本人对JS可谓是小白一个,现在有一个困难就是希望能够得到选中节点的ID和右键新增删除,不会啊,求高手给实例,要实例啊,详细点50分送上啊,很急!下面是在网上找到的方法,但是没实例所以不会用,很郁闷 很纠结:获取选中的节点Id
getSelectedItemId()getIndexById(itemId)
设置鼠标右键点击事件setOnRightClickHandler(func)
设置鼠标点击事件删除节点的所有子节点
deleteChildItems(itemId)删除节点
deleteItem(itemId,selectParent) //selectParent - If true parent of deleted item get selection, else no selected items leaving in tree.
注:新增的话 我只需要转到专门是新增的页面就行了!谢谢各位大大了!

解决方案 »

  1.   

    怎么没人啊,CSDN的高手都去哪了?
      

  2.   

     dhxToolbar1 = tabbar.cells("a1").attachToolbar();
                dhxToolbar1.setIconsPath("${request.getContextPath()}/resources/toolbarXml/icons/");
                dhxToolbar1.loadXML("${request.getContextPath() }/resources/toolbarXml/departmenttoolbar.xml?rt=" + new Date().valueOf());
                dhxToolbar1.attachEvent("onClick",function(id){
                 toAction(id);
             });
     function toAction(id){
    createWin(id,"新增公司",600,600,"${request.getContextPath()}/company/create")