62,074
社区成员
发帖
与我相关
我的任务
分享
//加载行政区域树数据
function loadTreeData(levelname) {
$.ajax({
url: './handler/GetAdministrationData.ashx',
dataType: 'json',
data: {
action: "getalldata",
levelname: levelname
},
async: false,
type: 'GET',
success: function (response) {
var tree = [];
for (var i = 0; i < response.Table.length; i++) {
var node = {
text: response.Table[i].Name_Zh,
icon: "glyphicon glyphicon-stop"
};
tree.push(node);
}
$('#tree').treeview({
data: tree,
onNodeSelected: function (event, node) {
var subnode = [{
text: 'test'
}];
$('#tree').treeview('addNode', [1,{
node : {
text : '000'
}
}]);
}
});
}
});
//加载行政区域树数据
function loadTreeData(levelname) {
$.ajax({
url: './handler/GetAdministrationData.ashx',
dataType: 'json',
data: {
action: "getalldata",
levelname: levelname
},
async: false,
type: 'GET',
success: function (response) {
var tree = [];
for (var i = 0; i < response.Table.length; i++) {
var node = {
text: response.Table[i].Name_Zh,
icon: "glyphicon glyphicon-stop"
};
tree.push(node);
}
$('#tree').treeview({
data: tree,
onNodeSelected: function (event, node) {
var subnode = [{
text: 'test'
}];
$('#tree').treeview('addNode', subnode,node);
}
});
}
});
}