多級分佈加載樹節點

Ext.onReady(function () {
            Ext.define('companyInfo', {
                extend: 'Ext.data.Model',
                fields: [ 'companyName','staffNum']
            });
            var treeStore1= Ext.create('Ext.data.TreeStore', {
                model: 'companyInfo',
                proxy: {
                    type: 'ajax',
                    url: 'Handler5.ashx',
                   // reader: 'json'
                },
               // nodeParam: 'orgId',nodeParam默認爲“node”
                //autoLoad: true,
                root: {//定義本store的根節點,後臺需要根的id來選擇加載根的節點。根的id默認是空的
                    name: '根節點',
                    id: '-1'
                }
            });
            Ext.create('Ext.tree.Panel', {
                title: '分級加載樹節點',
                renderTo: Ext.getBody(),
                width: 500,
                height: 350,
                store: treeStore1,
                //rootVisible:false,
                columns: [
                    { xtype:'treecolumn', text: '公司名稱', dataIndex: 'companyName', sortable: true, flex: 1 },
            { text: '員工人數', dataIndex: 'staffNum', sortable: true, flex: 1 }
                ]
            });
        });
        
        
        
        
        
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章