]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/dc/GroupView.js
use Proxmox.button.StdRemoveButton where possible
[pve-manager.git] / www / manager6 / dc / GroupView.js
index 0e412dbe7005cd827f592faf09c5c10b9e4cb5cc..ce679732b26078cd2d2e9df5f775dec8ff69373c 100644 (file)
@@ -3,6 +3,11 @@ Ext.define('PVE.dc.GroupView', {
 
     alias: ['widget.pveGroupView'],
 
+    onlineHelp: 'pveum_groups',
+
+    stateful: true,
+    stateId: 'grid-groups',
+
     initComponent : function() {
        var me = this;
 
@@ -20,27 +25,12 @@ Ext.define('PVE.dc.GroupView', {
 
        var sm = Ext.create('Ext.selection.RowModel', {});
 
-       var remove_btn = new PVE.button.Button({
-           text: gettext('Remove'),
-           disabled: true,
+       var remove_btn = Ext.create('Proxmox.button.StdRemoveButton', {
            selModel: sm,
-           confirmMsg: function (rec) {
-               return Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
-                                        "'" + rec.data.groupid + "'");
+           callback: function() {
+               reload();
            },
-           handler: function(btn, event, rec) {
-               PVE.Utils.API2Request({
-                   url: '/access/groups/' + rec.data.groupid,
-                   method: 'DELETE',
-                   waitMsgTarget: me,
-                   callback: function() {
-                       reload();
-                   },
-                   failure: function (response, opts) {
-                       Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-                   }
-               });
-           }
+           baseurl: '/access/groups/'
        });
 
        var run_editor = function() {
@@ -80,7 +70,6 @@ Ext.define('PVE.dc.GroupView', {
        Ext.apply(me, {
            store: store,
            selModel: sm,
-           stateful: false,
            tbar: tbar,
            viewConfig: {
                trackOver: false