pve-manager/www/manager6/dc/RoleView.js
Emmanuel Kasper c0b3df6e34 ext6migrate: listen to 'activate' events for panels inside a tabpanel
Using ExtJS6 a browser refresh (F5) do not send the 'show' event which we use to display the store as it did with ExtJS4.

At the momment only for tabs inside the datacenter tabpanel, since node and lxc tabpanels are not yet in manager6/
2016-01-22 11:24:20 +01:00

63 lines
1.0 KiB
JavaScript

Ext.define('PVE.dc.RoleView', {
extend: 'Ext.grid.GridPanel',
alias: ['widget.pveRoleView'],
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,
stateful: false,
viewConfig: {
trackOver: false
},
columns: [
{
header: gettext('Name'),
width: 150,
sortable: true,
dataIndex: 'roleid'
},
{
id: 'privs',
header: gettext('Privileges'),
sortable: false,
renderer: render_privs,
dataIndex: 'privs',
flex: 1
}
],
listeners: {
activate: function() {
store.load();
}
}
});
me.callParent();
}
});