2013-02-25 29 views
-1

javascript函數使用jQuery dynatree,我需要從dynatree事件onSelect打電話給我的功能。 例子:如何調用outter從dynatree事件

<script> 
    function fillAdditionCheckboxes(node){ 
      .... 
    } 

    $(".dynatree-wrapper", this.el).dynatree({ 
     narrowSearchProgress : false, 
     clickFolderMode: 1, 
     checkbox: false, 
     children: root.children, 
     selectMode:1, 
     onSelect:function (flag, node) { 
      //how I can call my function ???? 
      fillAdditionCheckboxes(node); 
     } 
    }); 
</script> 

回答

0

首先,你爲什麼要使用"narrowSearchProgress : false"?這不是一個有效的參數。 See the documentation

你的問題是什麼? dynatree被創建了嗎?你能夠選擇項目嗎?

<script> 
    function fillAdditionCheckboxes(node){ 
     .... 
    } 

    $(".dynatree-wrapper", this.el).dynatree({ 
     narrowSearchProgress : false, 
     clickFolderMode: 1, 
     checkbox: false, 
     children: root.children, 
     selectMode:1, 
     onSelect:function (flag, node) { 
      fillAdditionCheckboxes(node); 
     } 
    }); 
</script>