当前位置: 代码迷 >> Ajax >> Ext4 Tree读不出来数据,好手帮忙看看哪错了
  详细解决方案

Ext4 Tree读不出来数据,好手帮忙看看哪错了

热度:617   发布时间:2012-09-06 10:37:01.0
Ext4 Tree读不出来数据,高手帮忙看看哪错了
JScript code

Ext.regModel("TreeMenu",{
    fields:[
    {name: 'parentid',     type: 'string'},
    {name: 'text',     type: 'string'}
    ]
});

var store = new Ext.data.TreeStore({
    model:'TreeMenu',
    nodeParam:'parentid',  //指定节点参数名
    proxy:{
        type: 'ajax',
        url: 'TreeMenu.aspx',
        reader:'json'
    },
    autoLoad:true,
    root:{
        text:'根节点',
        parentid:'-1'
    }
});

var treenode = Ext.create('Ext.tree.Panel',{   
    store: store, 
    columns:[{
        xtype:'treecolumn',
        dataIndex:'text',
        sortable:true
    }],
    width:250,
    height:150,
    lines:false,
    useArrows : true,
    rootVisible:false,
    rootVisible: false
});



返回JSON数据
HTML code

[{id:"1",menucode:"xhfp",text:"发票管理",parentid:"0",leaf:false,iconCls:""},
{id:"2",menucode:"tjcx",text:"统计查询",parentid:"0",leaf:false,iconCls:""},
{id:"3",menucode:"jczl",text:"基础资料",parentid:"0",leaf:false,iconCls:""},
{id:"4",menucode:"qxgl",text:"权限管理",parentid:"0",leaf:false,iconCls:""},
{id:"5",menucode:"xtsz",text:"系统设置",parentid:"0",leaf:false,iconCls:""}]



------解决方案--------------------
C# code

    sorters:[{
        property:'text',
        direction:'ASC'
    }] 
  相关解决方案