jeecg随笔 -- combotree只选择叶子节点



editor : {
type : 'combotree',
options : {
url : '***********Action!ctrlTree.action',
animate : false,
lines : !sy.isLessThanIe8(),
onLoadSuccess : function(row, data) {
var t = $(this);
if (data) {
$(data).each(function(index, d) {
if (this.state == 'closed') {
t.tree('expandAll');
}
});
}
},
onBeforeSelect : function(node){
var t = $(this).tree;
var isLeaf = t('isLeaf', node.target);
if (!isLeaf) {//选择的不是叶子节点
return false;
}
}
}
}



在datagrid里的编辑模式下,限制 combotree 只能选择叶子节点的方式

--------------------------------------
在多选模式下,初始化 combotree ,只允许选择 叶子节点的话
可以使用
onlyLeafCheck : true 属性
即: 只在叶子节点出现 checkbox 框

参考文章链接:
http://blog.csdn.net/educast/article/details/7659496
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章