]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/form/GroupSelector.js
use RestProxy from widget toolkit
[pve-manager.git] / www / manager6 / form / GroupSelector.js
CommitLineData
26322062 1Ext.define('PVE.form.GroupSelector', {
0fc95a12 2 extend: 'Proxmox.form.ComboGrid',
26322062
DM
3 alias: ['widget.pveGroupSelector'],
4
5 allowBlank: false,
a13842bf
EK
6 autoSelect: false,
7 valueField: 'groupid',
8 displayField: 'groupid',
9 listConfig: {
10 columns: [
11 {
12 header: gettext('Group'),
13 sortable: true,
14 dataIndex: 'groupid',
15 flex: 1
16 },
17 {
18 header: gettext('Comment'),
19 sortable: false,
20 dataIndex: 'comment',
91535f2b 21 renderer: Ext.String.htmlEncode,
a13842bf
EK
22 flex: 1
23 }
24 ]
25 },
26322062
DM
26
27 initComponent: function() {
28 var me = this;
29
30 var store = new Ext.data.Store({
3253e118
DC
31 model: 'pve-groups',
32 sorters: [{
33 property: 'groupid'
34 }]
26322062
DM
35 });
36
37 Ext.apply(me, {
22f2f9d6 38 store: store
26322062
DM
39 });
40
41 me.callParent();
42
43 store.load();
44 }
45
46}, function() {
47
48 Ext.define('pve-groups', {
49 extend: 'Ext.data.Model',
50 fields: [ 'groupid', 'comment' ],
51 proxy: {
56a353b9 52 type: 'proxmox',
26322062
DM
53 url: "/api2/json/access/groups"
54 },
55 idProperty: 'groupid'
56 });
57
58});