环境 Extjs4.2

 

做tree一次性从后台加载数据的时候,发现返回了数据结构,包含了children子节点结合,前端还是会继续查询每个节点的子节点,最后发现是我这边TreeStore定义有问题,

Ext从后台一次性加载数据,循环获取子节点数据的问题插图

这里的root写了是res。但是后台传过来的时候,子节点写的是children。

private List<MenuTree> children;

 

这里将后台返回数据的子节点的名字改成res。就好了。

Ext从后台一次性加载数据,循环获取子节点数据的问题插图1

 

extjs原文如下。

For the tree to read nested data, the Ext.data.reader.Reader must be configured with a root property, so the reader can find nested data for each node (if a root is not specified, it will default to ‘children’). This will tell the tree to look for any nested tree nodes by the same keyword, i.e., ‘children’. If a root is specified in the config make sure that any nested nodes with children have the same name. Note that setting defaultRootProperty accomplishes the same thing.

extjs创建一个带checkbox的树


extjs tree实例,extjs带复选框的树

10 对 “Ext从后台一次性加载数据,循环获取子节点数据的问题”的想法;

  1. I was wondering if you ever considered changing the page layout of your blog?
    Its very well written; I love what youve got to say. But
    maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or 2 pictures.
    Maybe you could space it out better?

  2. Attractive element of content. I just stumbled upon your web site and in accession capital to say that I acquire in fact enjoyed account your weblog posts.
    Anyway I will be subscribing on your feeds or even I fulfillment you get entry to persistently rapidly.

  3. Greetings! I know this is kinda off topic however
    , I’d figured I’d ask. Would you be interested
    in trading links or maybe guest writing a blog article
    or vice-versa? My blog goes over a lot of the same subjects as yours and I feel we could greatly benefit from each other.

    If you’re interested feel free to send me an e-mail.
    I look forward to hearing from you! Superb blog by the way!

发表评论

电子邮件地址不会被公开。