当前位置: 代码迷 >> 综合 >> easyui-combotree 只允许选择叶子节点
  详细解决方案

easyui-combotree 只允许选择叶子节点

热度:50   发布时间:2023-12-16 21:43:31.0

html代码 

<td nowrap class="kv-label" style="text-align:right">所属区域:</td>
<td class="kv-content"><select id="regionTree" class="easyui-combotree" style="width:200px;"data-options="url:'<%=contextPath%>/wuye/chargeBatchUploadController/getRegionTree_noSecurity',parentField:'pid',textFiled:'text',idFiled:'id',panelHeight:'240',onBeforeSelect:isLeaf,onClick:showPanel"></select>
</td>

 js代码:

<script>var isLeaf = function (node) {if (!$(this).tree('isLeaf', node.target)) {return false;}};var showPanel = function (node) {if (!$(this).tree('isLeaf', node.target)) {$('#regionTree').combo('showPanel');}};
</script>

 

  相关解决方案