52,797
社区成员
发帖
与我相关
我的任务
分享
Ext.onReady(function(){
Ext.QuickTips.init();
var info = Ext.data.Record.create([
{name: 'id', type: 'int'},
{name: 'name', type: 'string'},
{name: 'pid', type: 'int'},
{name: 'position', type: 'int'},
{name: 'image', type: 'string'},
{name: 'innerhtml', type: 'string'},
{name: 'listDeep', type: 'int'},
{name: 'actionName', type: 'string'},
{name: 'actionIndex', type: 'string'},
{name: 'sid', type: 'int'}
]);
var store = new Ext.data.Store({
proxy: new Ext.data.DWRProxy(SystemController.GetModulesList, true),
reader: new Ext.data.ListRangeReader({
totalProperty: 'totalSize',
root: 'data',
id: 'id'
}, info),
remoteSort: true
});
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel([sm,
{header:'编号',dataIndex:'id'},
{header:'名称',dataIndex:'name'},
{header:'父编号',dataIndex:'pid'},
{header:'位置',dataIndex:'position'},
{header:'图片',dataIndex:'image'},
{header:'html',dataIndex:'innerhtml'},
{header:'深度',dataIndex:'listDeep'},
{header:'动作名称',dataIndex:'actionName'},
{header:'动作索引',dataIndex:'actionIndex'},
{header:'Sid',dataIndex:'sid'}
]);
var tbar=new Ext.Toolbar([
{
text : '添加',
tooltip : '添加一条模块信息',
iconCls : 'add',
onClick : function() {
alert('添加');
}
}, '-', {
text : '修改',
tooltip : '修改选中模块信息',
iconCls : 'option',
onClick : function() {
alert('修改');
}
}, '-', {
text : '删除',
tooltip : '删除选中的模块信息',
iconCls : 'remove',
onClick : function() {
alert('删除');
}
}]);
var bbar=new Ext.PagingToolbar({
pageSize : 20,
store : store,
displayInfo : true,
displayMsg : '显示第 {0} 条到 {1} 条记录,一共 {2} 条',
emptyMsg : "没有记录"
});
var grid = new Ext.grid.GridPanel({
renderTo: document.body,
autoHeight: true,
store: store,
cm: cm,
sm:sm,
tbar:tbar,
bbar: bbar,
width : 815,
stripeRows : true,
viewConfig : {
forceFit : true
},
autoHeight : true,
title : '人员信息列表',
iconCls : 'icon-grid'
});
store.load({params:{start:0,limit:20}});
});