]>
Commit | Line | Data |
---|---|---|
2c4780cc LW |
1 | Ext.define('PVE.form.NotificationTargetSelector', { |
2 | extend: 'Proxmox.form.ComboGrid', | |
3 | alias: ['widget.pveNotificationTargetSelector'], | |
4 | ||
5 | // set default value to empty array, else it inits it with | |
6 | // null and after the store load it is an empty array, | |
7 | // triggering dirtychange | |
8 | value: [], | |
9 | valueField: 'name', | |
10 | displayField: 'name', | |
11 | deleteEmpty: true, | |
12 | skipEmptyText: true, | |
13 | ||
14 | store: { | |
15 | fields: ['name', 'type', 'comment'], | |
16 | proxy: { | |
17 | type: 'proxmox', | |
18 | url: '/api2/json/cluster/notifications/targets', | |
19 | }, | |
20 | sorters: [ | |
21 | { | |
22 | property: 'name', | |
23 | direction: 'ASC', | |
24 | }, | |
25 | ], | |
26 | autoLoad: true, | |
27 | }, | |
28 | ||
29 | listConfig: { | |
30 | columns: [ | |
31 | { | |
32 | header: gettext('Target'), | |
33 | dataIndex: 'name', | |
34 | sortable: true, | |
35 | hideable: false, | |
36 | flex: 1, | |
37 | }, | |
38 | { | |
39 | header: gettext('Type'), | |
40 | dataIndex: 'type', | |
41 | sortable: true, | |
42 | hideable: false, | |
43 | flex: 1, | |
44 | }, | |
45 | { | |
46 | header: gettext('Comment'), | |
47 | dataIndex: 'comment', | |
48 | sortable: true, | |
49 | hideable: false, | |
50 | flex: 2, | |
51 | }, | |
52 | ], | |
53 | }, | |
54 | }); |