var para = $("#myFields").val();
para = encodeURI(para); //用js的这个方法给参数编码
$.post("impower.xhtml?method=getFieldsList",{entityName:para},function(result, textStatus){
result = $.trim(result);
if(result!=""){
var datas = result.split(",");
for( var i=0;i<datas.length;i++){
var tempStr = "{id:"+(i+1)+",pId:0,name:'"+datas[i]+"'}";
var node = eval("("+tempStr+")");
zNodes2.push(node);
}
$.fn.zTree.init($("#treeDemo"), setting,zNodes2);
}else{
$.fn.zTree.init($("#treeDemo"), setting);
}
});
//服务器端用 entityName = URLDecoder.decode(entityName,"UTF-8"); 解码