ext单页面实现框架页2

 

 

ajax请求的js代码的路径是写到了节点node的属性里,在初始化树节点的时候就已经动态的写好了

一个子模块的示例 用户管理

useradmin.js

 

// 用户管理模块

Ext.extend(Ext.Panel, {

constructor: function(config) {

// 表格模型

var cm = new Ext.grid.ColumnModel([

   {

        id: 'username',

        header: "姓名",

        dataIndex: 'username',

        width: 100

        

     },{

     id: 'email',

        header: "电子邮件",

        dataIndex: 'email',

        width: 100

     },{

     id: 'createdate',

        header: "注册时间",

        dataIndex: 'createdate',

        width: 100

     },{

        id: 'updatedate',

        header: "修改时间",

        dataIndex: 'updatedate',

        width: 100

     }]);

//console.log(basePath+'campaign/id/review');

// 数据来源储存

var user_store = new Ext.data.Store({

url: basePath+'users/ajaxserv',

 

reader: new Ext.data.JsonReader({

            root: 'users',

            totalProperty: 'totalCount',

            id: 'id'

        }, [

            'username', 'email', 'createdate', 'updatedate'

        ])

});

 

cm.defaultSortable = true;

 

user_store.load();

config = Ext.apply({

id: 'm_useradmin',

title: '用户管理',

autoScroll: true,

closable:true ,

    items:[

        new Ext.grid.GridPanel({

            store: user_store,

            cm: cm,

            stripeRows: true,

            height: 350,

            //width: 800,

            autoWidth : true,   

            loadMask: {msg:'正在加载数据,请稍后'},

            title: '用户列表'  ,

            tbar: [{ text: '添加', iconCls: 'new-item', tooltip: { title:'添加用户', text:'在此系统中注册一个新的用户'} }],

            bbar: new Ext.PagingToolbar({

                pageSize: 25,

                store: user_store,

                displayInfo: true,

                displayMsg: '显示记录 {0} - {1} of {2}',

                emptyMsg: "没有任何记录"

            })

        })

    ]

    }, config);

module.superclass.constructor.call(this, config);

}

});

来自:http://hi.baidu.com/wastorode/blog/item/68a073cb1aab9a2ff9dc617b.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值