]>
Commit | Line | Data |
---|---|---|
7e3fe38a | 1 | Ext.define('pve-groups', { |
3b1cb257 DC |
2 | extend: 'Ext.data.Model', |
3 | fields: [ 'groupid', 'comment' ], | |
4 | proxy: { | |
5 | type: 'proxmox', | |
6 | url: "/api2/json/access/groups" | |
7 | }, | |
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 DM |
14 | |
15 | allowBlank: false, | |
a13842bf EK |
16 | autoSelect: false, |
17 | valueField: 'groupid', | |
18 | displayField: 'groupid', | |
19 | listConfig: { | |
20 | columns: [ | |
21 | { | |
22 | header: gettext('Group'), | |
23 | sortable: true, | |
24 | dataIndex: 'groupid', | |
25 | flex: 1 | |
26 | }, | |
27 | { | |
28 | header: gettext('Comment'), | |
29 | sortable: false, | |
30 | dataIndex: 'comment', | |
91535f2b | 31 | renderer: Ext.String.htmlEncode, |
a13842bf EK |
32 | flex: 1 |
33 | } | |
34 | ] | |
35 | }, | |
26322062 DM |
36 | |
37 | initComponent: function() { | |
38 | var me = this; | |
39 | ||
40 | var store = new Ext.data.Store({ | |
3253e118 DC |
41 | model: 'pve-groups', |
42 | sorters: [{ | |
43 | property: 'groupid' | |
44 | }] | |
26322062 DM |
45 | }); |
46 | ||
47 | Ext.apply(me, { | |
22f2f9d6 | 48 | store: store |
26322062 DM |
49 | }); |
50 | ||
7e3fe38a | 51 | me.callParent(); |
26322062 DM |
52 | |
53 | store.load(); | |
54 | } | |
26322062 | 55 | }); |