发布于 2017-05-04 21:08:37 | 290 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

EasyUI jQuery UI插件

jQuery EasyUI是一组基于jQuery的UI插件集合,而jQuery EasyUI的目标就是帮助web开发者更轻松的打造出功能丰富并且美观的UI界面。开发者不需要编写复杂的javascript,也不需要对css样式有深入的了解,开发者需要了解的只有一些简单的html标签。


下面小编就为大家带来一篇EasyUI 中combotree 默认不能选择父节点的实现方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

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


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 默认不能选择父节点的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持phperz。



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务