pve-manager/www/manager6/dc/RoleView.js
Dominik Csapak 3190457463 make user/acl/auth grids stateful
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-17 09:16:30 +01:00

68 lines
1.1 KiB
JavaScript

Ext.define('PVE.dc.RoleView', {
extend: 'Ext.grid.GridPanel',
alias: ['widget.pveRoleView'],
onlineHelp: 'pveum_roles',
stateful: true,
stateId: 'grid-roles',
initComponent : function() {
var me = this;
var store = new Ext.data.Store({
model: 'pve-roles',
sorters: {
property: 'roleid',
order: 'DESC'
}
});
var render_privs = function(value, metaData) {
if (!value) {
return '-';
}
// allow word wrap
metaData.style = 'white-space:normal;';
return value.replace(/\,/g, ' ');
};
PVE.Utils.monStoreErrors(me, store);
Ext.apply(me, {
store: store,
viewConfig: {
trackOver: false
},
columns: [
{
header: gettext('Name'),
width: 150,
sortable: true,
dataIndex: 'roleid'
},
{
itemid: 'privs',
header: gettext('Privileges'),
sortable: false,
renderer: render_privs,
dataIndex: 'privs',
flex: 1
}
],
listeners: {
activate: function() {
store.load();
}
}
});
me.callParent();
}
});