52,797
社区成员
发帖
与我相关
我的任务
分享
后台返回的json:{success:true,data:{userId:2,username:'john'}},这种格式的
jq:
$.post('handler.asp',{username:'john',userpass:'123',rnd:new Date().getTime()},function(msg){alert(msg.data.username);},'json');浏览器报错
extjs:
alert(msg.data.username); 正确
这是为何?
你可以参照extJS的api文档,它那左侧的树有个搜索。主要是用filter完成的
我以前的项目也做了个,用的就是filter过滤的。我的树是一次加载完成的;
如果你想从后台完成搜索的话,那后天用sql语句模糊匹配,将匹配的数据以json
格式返回。到前台需要清空树的节点,将返回的数据节点加载到tree中即可