亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

前臺(tái)頁(yè)面:

<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頁(yè)面(包括數(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); 
        } 
      }); 
    } 
  }); 
} 

如上,關(guān)鍵代碼在onSelect事件中。

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

相關(guān)文章

最新評(píng)論