您现在的位置: 爱51代码网 >> 范文 >> 文章正文
easyui Tree 的json字符串拼接和异步载入

[{    "id":1,    "text":"评分项目",    "children":[{                  "id":11,                  "text":"项目一",                  "state":"closed",                  "children":[{                               "id":111,                               "text":"项目分支1",                               "state":"closed",                               "children":[{                                             "id":1111,                                             "text":"项目底层"                                         }]                               },{                               "id":112,                               "text":"项目分支2",                               "state":"closed",                               "children":[{                                             "id":1121,                                             "text":"项目底层"                                         }]                               }]                },{                    "id":12,                    "text":"项目二",                    "state":"closed",                    "children":[{                                 "id":121,                                 "text":"尺寸",                                 "state":"closed",                                 "children":[{                                               "id":1211,                                               "text":"方向"                                            },{                                               "id":1212,                                               "text":"方向2"                                            },{                                               "id":1213,                                               "text":"距离"                                            },{                                               "id":1214,                                               "text":"距离2"                                            }]                               }]                    } }]


前台设定载入代码如下:
       $(function () {             $('#BiaoZhun').tree({                 url: 'BiaoZhunTree.ashx',                // loadFilter: function(data){                    //    if (data.d){                    //        return data.d;                    //    } else {                    //        return data;                    //    }                    //}              });            });


网页DOM节点设置如下:

XML/HTML code?12 <ul id="BiaoZhun"></ul>
1.json倒数第二个符号'}'改为'}]'
2.URL后面的','去掉(因为后面的代码被你注释了)

  • 上一篇文章:

  • 下一篇文章: 没有了
  • 最新文章 热点文章 相关文章
    GIS用百度行政区域的经纬度直接画
    不小心卸载了.net 4 extend,vs2
    C#byte【】里的数转换成string时
    C#的session取不到值
    java如何判断一个字符串里的数字
    随机找出24个不一样的字,在把一
    java怎么实现html转为pdf
    lotus数据列表文档个数如何实时统
    lotus代理中LS如何将字符串保存到
    在lotus BS系统里怎样方便实现统
    GIS用百度行政区域的经纬度直接画
    不小心卸载了.net 4 extend,vs2
    C#byte【】里的数转换成string时
    C#的session取不到值
    java如何判断一个字符串里的数字
    java怎么实现html转为pdf
    lotus数据列表文档个数如何实时统
    在lotus BS系统里怎样方便实现统
    undefined reference timer_crea
    linux文件/usr/lib破坏了,还原后
    datagrid在显示Long类型数据
    如何从一个页面控制另一个页
    百度文库显示PPT和word的方法
    iframe里如何获取点击事件
     



    设为首页 | 加入收藏 | 网站地图 | 友情链接 |