// 查询树形标准区域方法定义
function flashFuncTree() {
$("#xtgl_bzqyglMain_tree").tree({
data : {
type : 'json',
url : $webroot + '/com/yxd/pris/xtgl/bzqygl/queryTAkfAreaCodeForTree.action',
async : true,
async_data : function (NODE) {
var paramTemp = $(NODE).attr("areaid");
var idTemp = "";
var isRootTemp = 1;
if(typeof(paramTemp) != 'undefined'){//用户选择
idTemp = paramTemp;
isRootTemp = 0;
}else{
idTemp = common.all.initId;
}
return { id : idTemp ,isRoot : isRootTemp}
},
method : 'GET'
},
callback : {
onselect : function(NODE, TREE_OBJ) {
// 设置父节点全局的变量
setPfunCode($(NODE).attr("nodeCode"));
$("#xtgl_bzqyglMain_treegrid").flexSearch([{
name : "akfAreaCodeSearchModel.pareaId",
value : getPfunCode()
}]);
var title = "区域维护 : (" + $(NODE).attr("title") + ")下的区域";
$("#xtgl_bzqyglMain_treegrid").setGridTitle(title);
$("#xtgl_bzqyglMain_selectedId").val(getPfunCode());
$("#xtgl_bzqyglMain_selectedTitle").val($(NODE)
.attr("title"));
},
onJSONdata : function(DATA, TREE_OBJ) {
var re = DATA.result.children;
var removeattr = function(rootarray, attrs) {
if (rootarray) {
for (var i = 0, len = rootarray.length; i < len; i++) {
if (rootarray[i]) {
for (var j = 0, len = attrs.length; j < len; j++) {
delete rootarray[i].attributes[attrs[j]];
}
removeattr(rootarray[i].children, attrs);
}
}
}
}
// removeattr(re, ["target", "href", "flesh", "rel"]);
flag=true;
tns.reflushTree = function(){
TREE_OBJ.refresh($("#xtgl_bzqyglMain_tree"));
}
return re;
},
onopen : function() {
}
},
onload : function(TREE_OBJ) {setPfunCode($(NODE).attr("1")) },
ui : {
context : []
}
});
}