Commit a8875ec0 authored by Dietmar Maurer's avatar Dietmar Maurer

allow to edit existing groups

parent ae4c9054
...@@ -24,8 +24,8 @@ Ext.define('PVE.dc.GroupEdit', { ...@@ -24,8 +24,8 @@ Ext.define('PVE.dc.GroupEdit', {
method: method, method: method,
items: [ items: [
{ {
xtype: 'pvetextfield', xtype: me.create ? 'pvetextfield' : 'displayfield',
fieldLabel: 'ID', fieldLabel: gettext('Name'),
name: 'groupid', name: 'groupid',
value: me.groupid, value: me.groupid,
allowBlank: false allowBlank: false
......
...@@ -43,6 +43,25 @@ Ext.define('PVE.dc.GroupView', { ...@@ -43,6 +43,25 @@ Ext.define('PVE.dc.GroupView', {
} }
}); });
var run_editor = function() {
var rec = sm.getSelection()[0];
if (!rec) {
return;
}
var win = Ext.create('PVE.dc.GroupEdit',{
groupid: rec.data.groupid
});
win.on('destroy', reload);
win.show();
};
var edit_btn = new Ext.Button({
text: gettext('Edit'),
disabled: true,
handler: run_editor
});
var tbar = [ var tbar = [
{ {
text: gettext('Create'), text: gettext('Create'),
...@@ -53,7 +72,7 @@ Ext.define('PVE.dc.GroupView', { ...@@ -53,7 +72,7 @@ Ext.define('PVE.dc.GroupView', {
win.show(); win.show();
} }
}, },
remove_btn edit_btn, remove_btn
]; ];
Ext.apply(me, { Ext.apply(me, {
...@@ -79,7 +98,8 @@ Ext.define('PVE.dc.GroupView', { ...@@ -79,7 +98,8 @@ Ext.define('PVE.dc.GroupView', {
} }
], ],
listeners: { listeners: {
show: reload show: reload,
itemdblclick: run_editor
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment