欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

easyui中combotree循環(huán)獲取父節(jié)點至根節(jié)點并輸出路徑實現(xiàn)方法

 更新時間:2016年11月10日 08:38:42   投稿:jingxian  
下面小編就為大家?guī)硪黄猠asyui中combotree循環(huán)獲取父節(jié)點至根節(jié)點并輸出路徑實現(xiàn)方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

前臺頁面:

<pre name="code" class="html"><td style="height: 35px" colspan="7"> 
   <input id="fm_AEType" class="easyui-combotree" style="width: 240px" /> 
   <label id="fm_AETypePath" /> 
</td></pre> 

 JavaScript頁面(包括數(shù)據(jù)初始化):

initAEType: function () { 
  $.ajax({ 
    url: AEActionUrl + '?action=listaetype&ParentType=', 
    dataType: 'json', 
    success: function (jsonstr) { 
      $('#fm_AEType').combotree({ 
        data: jsonstr, 
        editable: false, 
        //lines: true, 
        valueField: 'AE_TYPE_ID', 
        textField: 'AE_TYPE_NAME', 
        onLoadSuccess: function () { 
          $('#fm_AEType').combotree('tree').tree("collapseAll"); 
        }, 
        onSelect: function (item) { 
          var parent = item; 
          var tree = $('#fm_AEType').combotree('tree'); 
          var path = new Array(); 
          do { 
            path.unshift(parent.text); 
            var parent = tree.tree('getParent', parent.target); 
          } while (parent); 
          var pathStr = ''; 
          for (var i = 0; i < path.length; i++) { 
            pathStr += path[i]; 
            if (i < path.length - 1) { 
              pathStr += ' - '; 
            } 
          } 
          $('#fm_AETypePath').text(pathStr); 
        } 
      }); 
    } 
  }); 
} 

如上,關鍵代碼在onSelect事件中。

以上就是小編為大家?guī)淼膃asyui中combotree循環(huán)獲取父節(jié)點至根節(jié)點并輸出路徑實現(xiàn)方法全部內容了,希望大家多多支持腳本之家~

相關文章

最新評論