日期:2014-05-16 浏览次数:20395 次
Ext.define("OA.view.role.List", {
extend: "Ext.grid.Panel",
alias: "widget.rolelist",
store: "role.RoleSto",
dockedItems: [{
xtype: "toolbar",
dock: "top",
layout: "vbox",
padding: 0,
border: 0,
items: [{
xtype: "form",
id: "gridform",
bodyStyle: {
background: "transparent"
},
width: "100%",
height: 40,
padding: 5,
margin: 0,
border: 0,
layout: {
type: "table",
columns: 5
},
defaults: {
labelAlign: "right"
},
items: [{
xtype: "textfield",
fieldLabel: "角色名",
name: "paramMap.name",
id: "roleName",
labelAlign: "right"
}, {
xtype: "textfield",
fieldLabel: "角色信息",
name: "paramMap.info",
id: "roleInfo",
labelAlign: "right"
}, /*{
xtype: 'datefield',
fieldLabel: '开始时间',
name: 'from_date',
maxValue: new Date(),
width: 220
}, {
xtype: 'datefield',
fieldLabel: '结束时间',
name: 'end_date',
maxValue: new Date(),
width: 220
},*/ {
xtype: "button",
text: "查询",
margin: "0 0 0 10",
id: "rolelistsearch",
iconCls: "Magnifier"
}]
}, {
xtype: "toolbar",
width: "100%",
padding: 0,
margin: 0,
border: "1 1 0 0",
items: [{
xtype: "button",
text: "新增",
id: "addRoleBtn",
iconCls: "Add"
}]
}]
}, {
xtype: "pagingtoolbar",
store: "role.RoleSto",
dock: "bottom",
displayInfo: true
}],
listeners: {
afterrender: function(grid, eOpts) {
grid.getStore().load();
}
},
columns: [{
header: "主键id", dataIndex: "id", hidden: true
}, {
header: "角色名", dataIndex: "name", width: "30%"
}, {
header: "角色信息", dataIndex: "info", width: "69%"
}],
initComponent: function() {
this.callParent(arguments);
}
});
Ext.define("OA.controller.role.RoleCtrl", {
extend: "Ext.app.Controller",
models: ["role.RoleMdl"],
stores: ["role.RoleSto"],
views: ["role.List", "role.Add"],
init: function() {
this.control({
"rolelist button[id=addRoleBtn]": {
click: this.addRole
},
"rolelist button[id=rolelistsearch]": {
click: this.searchRoleList
},
"addrole button[id=saveRoleBtn]": {
click: this.saveRole
}
});
},
addRole: function(btn, e, eOpts)&nb