]>
Commit | Line | Data |
---|---|---|
26322062 DM |
1 | Ext.define('PVE.form.GroupSelector', { |
2 | extend: 'PVE.form.ComboGrid', | |
3 | alias: ['widget.pveGroupSelector'], | |
4 | ||
5 | allowBlank: false, | |
6 | ||
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, | |
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 | { | |
26322062 DM |
28 | header: gettext('Comment'), |
29 | sortable: false, | |
30 | dataIndex: 'comment', | |
31 | flex: 1 | |
32 | } | |
33 | ] | |
34 | } | |
35 | }); | |
36 | ||
37 | me.callParent(); | |
38 | ||
39 | store.load(); | |
40 | } | |
41 | ||
42 | }, function() { | |
43 | ||
44 | Ext.define('pve-groups', { | |
45 | extend: 'Ext.data.Model', | |
46 | fields: [ 'groupid', 'comment' ], | |
47 | proxy: { | |
48 | type: 'pve', | |
49 | url: "/api2/json/access/groups" | |
50 | }, | |
51 | idProperty: 'groupid' | |
52 | }); | |
53 | ||
54 | }); |