seeRoleUser: function (grid,view, rowindex, colindex, item, record) {
Common.util.Util.doAjax({
url: Common.Config.requestPath('System', 'Roles', 'queryRoleUsers'),
method: 'get',
params: {roleId: record.get('id')}
}, function (data) {
var RolUserWindow = Ext.create('Ext.window.Window', {
title: '角色用户',
closeToolText: '关闭窗口',
layout: 'fit',
modal: true,
height: 250,
width: 300,
items: {
xtype: 'form',
items: [{xtype: 'hidden', name: 'roleId', value: record.get('id')}, {
xtype: 'tagfield',
fieldLabel: '角色用户列表',
store: Ext.create('Ext.data.Store', {
autoLoad: true,
proxy: {
type: 'ajax',
extraParams: {
roleId: record.get('id')
},
url: Common.Config.requestPath('System','Roles','queryRoleUsers'),
reader: {
type: 'json',
rootProperty: 'data.users'
}
}
}),
valueField: "userId",
displayField: "realname",
name: 'userId'
,filterPickList: true,
value: data.data.userIds
}],
buttons: [{
text: '确定',
handler: function () {
var me = this,
form = me.up('form');
if (!form.isValid()) {
return false;
}
var formValues = form.getValues();
var userIds = formValues.userId;
if(userIds!=null&&userIds!=''){
userIds.join(',');
}
Common.util.Util.doAjax({
url: Common.Config.requestPath('System', 'Roles', 'updateRoleUser'),
method: 'post',
params: {userIds:userIds,roleId:formValues.roleId}
}, function (data) {
RolUserWindow.close();
Common.util.Util.toast("角色用户更改成功");
});
}
}]
}
});
RolUserWindow.show();
});
},
Ext tagfield 应用
最新推荐文章于 2022-03-26 10:02:05 发布