<script type="text/javascript">
var IDS=new Array();
Ext.onReady(function(){
var roleCombox;
var bbar;
Ext.BLANK_IMAGE_URL = "<%=basePath%>js/extjs/resources/images/default/s.gif";
Ext.QuickTips.init();
Ext.lib.Ajax.defaultPostHeader+=";charset=utf-8";
var cm=new Ext.grid.ColumnModel([
{header:'角色名称',dateIndex:'ROLE_NAME',sortable:true},
{header:'创建人',dataIndex:'CREATE_USER_NAME',sortable:true},
{header:'创建时间',dataIndex:'CREATE_TIME',sortable:true}
]);
//数据源的获取
var store = new Ext.data.Store({
reader: new Ext.data.JsonReader({
totalProperty: "results",
root: "items",
id: "store"
},
Ext.data.Record.create(['ROLE_NAME','CREATE_USER_NAME','CREATE_TIME','ROLE_ID'])
),
proxy : new Ext.data.HttpProxy({
url : '<%=basePath%>system/role_findRole.action'
});
store.load({params:{start:0, limit:25}});
var tbar=new Ext.Toolbar({
name:'usertbar',
id:'usertbar'
});
tbar.render('toolbar');
var comboxRoleStore=new Ext.data.JsonStore({
url:'<%=basePath%>system/role_findRoleByCom.action',
root:'items',
totalProperty: 'results',
fields:[
{name:'ROLE_ID', mapping:'ROLE_ID'},
{name:'ROLE_NAME', mapping:'ROLE_NAME'}
],
disableCaching:false,
autoLoad:true
});
roleCombox=new Ext.form.ComboBox({
xtype : 'combo',
name:'ROLE_ID',
id:'ROLE_ID',
store: comboxRoleStore,
displayField:'ROLE_NAME',
valueField:'ROLE_NAME',
emptyText:'请输入查询',
width:160,
listWidth:200,
minHeight:100,
editable:true,
allowBlank:true,
mode:'local',
typeAhead: false,
loadingText:'loading...',
hiddenName:'ROLE_NAME',
triggerAction:'all',
onKeyUp : function(e){
var a=e.getKey();
if(e.getKey()==e.SPACE||(parseInt(a)>48&&parseInt(a)<58)){
this.store.baseParams = { query:this.getEl().dom.value };
this.collapse();
this.store.reload();
}
}
});
comboxRoleStore.load({params:{query:roleCombox.getRawValue(),start:0,limit:10}});
var searchBus=new Ext.Toolbar.Button({text:'查询',handler:searchRole,cls:'x-btn-text-icon',icon: 'images/ico/sousuo.gif'});
var roleCreate=new Ext.Toolbar.Button({text:'新增',handler:create,cls:'x-btn-text-icon',icon: 'images/ico/tianjia.gif'});
var roleDelete=new Ext.Toolbar.Button({text:'删除',handler:deleteRole,cls:'x-btn-text-icon',icon: 'images/ico/shanchu.gif'});
var roleModify=new Ext.Toolbar.Button({text:'修改',handler:modify,cls:'x-btn-text-icon',icon: 'images/ico/xiugai.gif'});
var roleMenu=new Ext.Toolbar.Button({text:'角色配置菜单',handler:addRoleMenu,cls:'x-btn-text-icon',icon: 'images/ico/shezhi.gif'});
var rolefun=new Ext.Toolbar.Button({text:'角色功能权限',handler:findmenurole,cls:'x-btn-text-icon',icon: 'images/ico/shenzhi.gif'});