]>
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 | { | |
28 | id: 'comment', | |
29 | header: gettext('Comment'), | |
30 | sortable: false, | |
31 | dataIndex: 'comment', | |
32 | flex: 1 | |
33 | } | |
34 | ] | |
35 | } | |
36 | }); | |
37 | ||
38 | me.callParent(); | |
39 | ||
40 | store.load(); | |
41 | } | |
42 | ||
43 | }, function() { | |
44 | ||
45 | Ext.define('pve-groups', { | |
46 | extend: 'Ext.data.Model', | |
47 | fields: [ 'groupid', 'comment' ], | |
48 | proxy: { | |
49 | type: 'pve', | |
50 | url: "/api2/json/access/groups" | |
51 | }, | |
52 | idProperty: 'groupid' | |
53 | }); | |
54 | ||
55 | }); |