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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章