欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

關(guān)于extjs treepanel復(fù)選框選中父節(jié)點與子節(jié)點的問題

 更新時間:2013年04月02日 15:06:02   作者:  
實現(xiàn)帶有復(fù)選框的樹,選中父節(jié)點時,選中所有子節(jié)點。取消所有子節(jié)點時,才能取消根節(jié)點,感興趣的朋友可以了解下本文
 
extjs 如圖,實現(xiàn)帶有復(fù)選框的樹,選中父節(jié)點時,選中所有子節(jié)點。取消所有子節(jié)點時,才能取消根節(jié)點。
復(fù)制代碼 代碼如下:

var Fpanel = new Ext.tree.TreePanel({
id:'ptree',
region:'west',
layout:'anchor',
border:false,
rootVisible: false,
root:new Ext.tree.AsyncTreeNode({}),
listeners:{
"checkchange": function(node, state) {
if (node.parentNode != null) {
//子節(jié)點選中
node.cascade(function(node){
node.attributes.checked = state;
node.ui.checkbox.checked = state;
return true;
});
//父節(jié)點選中
var pNode = node.parentNode;
if (state || Fpanel.getChecked(id, pNode) == "") {
pNode.ui.toggleCheck(state);
pNode.attributes.checked = state;
}
}
}
}
});
authorityTree(Fpanel);
var authorityTree = function(Fpanel){
Ext.Ajax.request({
url: 'authorityTree.ashx',
method:'get',
success: function(request) {
var data = Ext.util.JSON.decode(request.responseText);
Fpanel.getRootNode().appendChild(data);
Fpanel.getRootNode().expandChildNodes(true);
Fpanel.expandAll();
},
failure: function() {
Fpanel.render();
Ext.MessageBox.show({
title: '提示',
msg: '服務(wù)器忙,請使用火狐瀏覽器瀏覽或稍后重試!',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
});
}

相關(guān)文章

最新評論