]>
Commit | Line | Data |
---|---|---|
b5572d7f DM |
1 | Ext.define('PVE.form.GroupSelector', { |
2 | extend: 'PVE.form.ComboGrid', | |
3 | alias: ['widget.pveGroupSelector'], | |
4 | ||
58eb5905 DM |
5 | allowBlank: false, |
6 | ||
b5572d7f DM |
7 | initComponent: function() { |
8 | var me = this; | |
9 | ||
10 | var store = new Ext.data.Store({ | |
11 | model: 'pve-groups' | |
12 | }); | |
13 | ||
14 | Ext.apply(me, { | |
15 | store: store, | |
b5572d7f DM |
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 | id: 'comment', | |
0070ee37 | 29 | header: gettext('Comment'), |
b5572d7f DM |
30 | sortable: false, |
31 | dataIndex: 'comment', | |
5171a299 | 32 | renderer: Ext.String.htmlEncode, |
b5572d7f DM |
33 | flex: 1 |
34 | } | |
35 | ] | |
36 | } | |
37 | }); | |
38 | ||
39 | me.callParent(); | |
40 | ||
41 | store.load(); | |
42 | } | |
43 | ||
44 | }, function() { | |
45 | ||
46 | Ext.define('pve-groups', { | |
47 | extend: 'Ext.data.Model', | |
48 | fields: [ 'groupid', 'comment' ], | |
49 | proxy: { | |
50 | type: 'pve', | |
7a6b5d9f | 51 | url: "/api2/json/access/groups" |
b5572d7f DM |
52 | }, |
53 | idProperty: 'groupid' | |
54 | }); | |
55 | ||
56 | }); |