日期:2014-05-16  浏览次数:20588 次

ExtJs4如何实现树状结构前的图标
以下是我现在有问题部分的代码,判断是否是节点的字段是

ed.doc.loader = new Ext.data.TreeStore({
        proxy: {
         type: 'ajax',
            url : 'action/docTreeListSearchController',
            reader : {
           type : 'json',
           root : 'docTreeList'
         },
         extraParams : {
           docUnitId : ed.doc.parDocUnitId
         }},
         root : {
              id : 'xnode',
              text : ed.resources.DOC_TREE_ROOT,
              expanded : true
          
            }
     });
var tree = new Ext.tree.Panel({
   useArrows: true,
        id : 'tree',
        title : ed.resources.DOC_TAB_TIT_TREE,
        autoScroll : true,
        iconCls : 'tabHierarchy',
        enableDD : false,
        animate: true,
        containerScroll: true,
//        root : new Ext.tree.AsyncTreeNode({
//              id : 'xnode',
//              text : ed.resources.DOC_TREE_ROOT,
//              expanded : true
//            }),
        store : ed.doc.loader
      });

数据结构是以下这样

{"docTreeList":[{"id":"1101130969","text":"ww","leaf":false},{"id":"1101130838","text":"張","leaf":false},
{"id":"1101130814","text":"張1","leaf":false},{"id":"1101130871","text":"qqq","leaf":false},{"id":"1101130847","text":"wz_floder","leaf":false}
}
extjs tree javascript 数据结构 ajax

------解决方案--------------------
判断是否是叶子节点就是json里面的 "leaf":false 这个字段呀!lz想问的是这个吗?