×

EasyUI 中combotree 默认不能选择父节点的实现方法

作者:Terry2017.01.28来源:Web前端之家浏览:1158评论:0
关键词:JQueryJS

这需要添加如下字段就行,搜了半天,说什么判断是不是子节点什么的,都是胡扯!

onlyLeafCheck:true,
//病因分类 
$('#artReason').combotree({
width:200,
method:'GET',
  //url: '${ctx}/business/dict/json/DicEtilolgy',
  data:DicEtilolgy_data,
  idField : 'id',
  textFiled : 'name',
parentField : 'pid',
  animate:true,
  mode:'local',
  multiple: true,
  onlyLeafCheck:true,
  onbeforeselect:function(node){
  debugger;
        alert(node.state);
        if(node.state){
          $("#artReason").tree("unselect");
        }
      },
onClick:function(data){
return;
debugger;
},
  onLoadSuccess:function(node,data){
//   $("#artReason").combotree('setValue',['11','12']);
  
  },
//  onSelect : function(node) { 
//   debugger;
//   if(parseInt(node.id)<10){
//   $('#artReason').combotree('clear');
//   return;
//   }
//    //返回树对象 
//    var tree = $(this).tree; 
//    //选中的节点是否为叶子节点,如果不是叶子节点,清除选中 
//    var isLeaf = tree('isLeaf', node.target); 
//    if (!isLeaf) { 
//      //清除选中 
//      $('#artReason').combotree('clear'); 
//    } 
//  }, 
  onChange:function(newValue, oldValue) { 
  debugger;
  },
//  filter:function(q,row){ 
//   debugger;
//   var opts=$(this).combobox("options"); 
//   return row[opts.textField].indexOf(q)>-1;//将从头位置匹配改为任意匹配 
//   },
});

以上这篇EasyUI 中combotree 默认不能选择父节点的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

您的支持是我们创作的动力!
温馨提示:本文作者系Terry ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://www.jiangweishan.com/article/svg1485532800639.html

网友评论文明上网理性发言 已有0人参与

发表评论: