解决方案 »

  1.   

    getRootNode 没这个方法?卤煮是不是自定义了这个方法?
      

  2.   


    没有的,要是我在store定义root:{},浏览器报错变为:has no method 'setRootNode'.我试着不通过加载store,直接将treeGrid展示出来,一点问题都没有,代码如下: var procurementplanTreeGrid = Ext.create('Ext.tree.Panel', {
    tbar : procurementplantoolbar,
    store : procurementplanstore,
    region : 'center',
    renderTo : Ext.getBody(),
    collapsible : true,
    useArrows : true,
    rootVisible : true,
    multiSelect : true,
    singleExpand : true,
    selModel : new Ext.selection.CheckboxModel(),
    columnLines : true,
    forceFit : true
    selModel : new Ext.selection.CheckboxModel(),
    fields : [ 'name', 'description' ],
    columns : [ {
    xtype : 'treecolumn',//树状表格列   
    text : '名称',
    dataIndex : 'name',
    width : 100,
    sortable : true
    }, {
    text : '描述',
    dataIndex : 'description',
    //flex : 1,
    sortable : true
    } ],
    root : {
    name : '树根',
    text : 'root',
    description : '树根的描述',
    expanded : true,
    children : [ {
        name : '节点一',
    text : '节点一',
    description : '节点一的描述',
    leaf : true
    }, {
        name : '节点二',
    text : '节点二',
    description : '节点二的描述',
    leaf : true
    } ]
    }
    });恳请高人解答,LZ被纠结了2天。
      

  3.   

    对不起,上面的store : procurementplanstore, 应该是注释掉的。
      

  4.   

    数据源要使用Ext.data.TreeStore,不是Ext.data.Store,数据源类型搞错了吧,楼主自己找api来看
      

  5.   

    你好,你的代码把//store : procurementplanstore,  这句注释掉后,能正常显示
    界面,一般来讲对于tree.panel我们用treestore吧;还有你贴上来的代码,最后一个
    括号是中文状态的。