ztree 获取选中节点的值

ztree 获取选中节点的值_第1张图片

var setting = {
	check: {
		enable: true,
		chkboxType:{"Y" : "ps", "N" : "ps"}
	},
	data: {
		simpleData: {
			enable: true
		}
	}
};

var table = {
	// 获取标签	
	getRegion : function(){
		var data = {};
		ws.tools.ajaxRequest({
			url : SystemGlobal.baseUrl+"/kuaishou/tools/getRegion",
			dataType : 'json',
			type : 'get',
			successfun : function(response) {
				if(response.status == 0){
					data = response.data;
				}
			},
			errorfun : function() {
				ws.tools.modalDialog.alert('请求失败!',2);
			}
		});
		return data;
	},
		
}
$(document).ready(function(){
	var data = table.getRegion();
	$.fn.zTree.init($("#treeDemo"), setting, data);
	
	$('#submitBtn').click(function(){
		var zTreeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
		var nodes = zTreeObj.getCheckedNodes(true);
		var ids = [];
		for(var i=0;i

主要代码

var zTreeObj = $.fn.zTree.getZTreeObj("treeDemo"); 
		var nodes = zTreeObj.getCheckedNodes(true);
		var ids = [];
		for(var i=0;i

 

你可能感兴趣的:(ztree)