easyui 看不懂。求解释。为什么要这样写,每一句的意思。包括参数里的东西代表什么。
vartreeOptions={url:'treeArea.action',onLoadSuccess:function(node,data){varrootNode=$...
var treeOptions={
url: 'treeArea.action',
onLoadSuccess:function(node,data){
var rootNode=$('#tre').tree('getRoot');
if (!rootNode) return;
//var childrenNode=$('#tre').tree('getChildren',rootNode.target);
//var selectNode=childrenNode[0];
$('#tre').tree('collapseAll');
},
onClick:function(node){
var strNode = node.id;
if (strNode.indexOf("D") == -1){
$.messager.alert('提示','请选择对应的最低区域级别!','info');
//alert("请选择对应的队!");
}else{
var strD = strNode.substring(1,strNode.indexOf("X"));
var strX = strNode.substring(strNode.indexOf("X")+1,strNode.indexOf("C"));
var strC = strNode.substring(strNode.indexOf("C")+1,strNode.indexOf("("));
var strAdd = strNode.substring(strNode.indexOf("(")+1,strNode.indexOf(")"));
$id('strXz').value = strX;
$id('strC').value = strC;
$id('strD').value = strD;
$id('strAddress').value = strAdd;
}
}
}
$(function(){
$('#tre').tree(treeOptions);
}); 展开
url: 'treeArea.action',
onLoadSuccess:function(node,data){
var rootNode=$('#tre').tree('getRoot');
if (!rootNode) return;
//var childrenNode=$('#tre').tree('getChildren',rootNode.target);
//var selectNode=childrenNode[0];
$('#tre').tree('collapseAll');
},
onClick:function(node){
var strNode = node.id;
if (strNode.indexOf("D") == -1){
$.messager.alert('提示','请选择对应的最低区域级别!','info');
//alert("请选择对应的队!");
}else{
var strD = strNode.substring(1,strNode.indexOf("X"));
var strX = strNode.substring(strNode.indexOf("X")+1,strNode.indexOf("C"));
var strC = strNode.substring(strNode.indexOf("C")+1,strNode.indexOf("("));
var strAdd = strNode.substring(strNode.indexOf("(")+1,strNode.indexOf(")"));
$id('strXz').value = strX;
$id('strC').value = strC;
$id('strD').value = strD;
$id('strAddress').value = strAdd;
}
}
}
$(function(){
$('#tre').tree(treeOptions);
}); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询