]>
Commit | Line | Data |
---|---|---|
7e3fe38a | 1 | Ext.define('pve-groups', { |
3b1cb257 | 2 | extend: 'Ext.data.Model', |
8058410f | 3 | fields: ['groupid', 'comment', 'users'], |
3b1cb257 DC |
4 | proxy: { |
5 | type: 'proxmox', | |
f6710aac | 6 | url: "/api2/json/access/groups", |
3b1cb257 | 7 | }, |
f6710aac | 8 | idProperty: 'groupid', |
7e3fe38a RJ |
9 | }); |
10 | ||
26322062 | 11 | Ext.define('PVE.form.GroupSelector', { |
0fc95a12 | 12 | extend: 'Proxmox.form.ComboGrid', |
7e3fe38a | 13 | xtype: 'pveGroupSelector', |
26322062 | 14 | |
44e5325e FE |
15 | editable: true, |
16 | anyMatch: true, | |
17 | forceSelection: true, | |
18 | ||
26322062 | 19 | allowBlank: false, |
a13842bf EK |
20 | autoSelect: false, |
21 | valueField: 'groupid', | |
22 | displayField: 'groupid', | |
23 | listConfig: { | |
24 | columns: [ | |
25 | { | |
26 | header: gettext('Group'), | |
27 | sortable: true, | |
28 | dataIndex: 'groupid', | |
f6710aac | 29 | flex: 1, |
a13842bf EK |
30 | }, |
31 | { | |
32 | header: gettext('Comment'), | |
33 | sortable: false, | |
34 | dataIndex: 'comment', | |
91535f2b | 35 | renderer: Ext.String.htmlEncode, |
f6710aac | 36 | flex: 1, |
88ac19dd FG |
37 | }, |
38 | { | |
39 | header: gettext('Users'), | |
40 | sortable: false, | |
41 | dataIndex: 'users', | |
1011b569 | 42 | renderer: Ext.String.htmlEncode, |
f6710aac TL |
43 | flex: 1, |
44 | }, | |
45 | ], | |
a13842bf | 46 | }, |
26322062 DM |
47 | |
48 | initComponent: function() { | |
49 | var me = this; | |
50 | ||
51 | var store = new Ext.data.Store({ | |
3253e118 DC |
52 | model: 'pve-groups', |
53 | sorters: [{ | |
f6710aac TL |
54 | property: 'groupid', |
55 | }], | |
26322062 DM |
56 | }); |
57 | ||
58 | Ext.apply(me, { | |
f6710aac | 59 | store: store, |
26322062 DM |
60 | }); |
61 | ||
7e3fe38a | 62 | me.callParent(); |
26322062 DM |
63 | |
64 | store.load(); | |
f6710aac | 65 | }, |
26322062 | 66 | }); |