]> git.proxmox.com Git - proxmox-widget-toolkit.git/blame - src/form/NotificationFilterSelector.js
notification ui: add target selector for matcher
[proxmox-widget-toolkit.git] / src / form / NotificationFilterSelector.js
CommitLineData
90dbb2d3
LW
1Ext.define('Proxmox.form.NotificationFilterSelector', {
2 extend: 'Proxmox.form.ComboGrid',
3 alias: ['widget.pmxNotificationFilterSelector'],
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 allowBlank: true,
14 editable: false,
15 autoSelect: false,
16
17 listConfig: {
18 columns: [
19 {
20 header: gettext('Filter'),
21 dataIndex: 'name',
22 sortable: true,
23 hideable: false,
24 flex: 1,
25 },
26 {
27 header: gettext('Comment'),
28 dataIndex: 'comment',
29 sortable: true,
30 hideable: false,
31 flex: 2,
32 },
33 ],
34 },
35
36 initComponent: function() {
37 let me = this;
38
39 Ext.apply(me, {
40 store: {
41 fields: ['name', 'comment'],
42 proxy: {
43 type: 'proxmox',
44 url: `/api2/json/${me.baseUrl}/filters`,
45 },
46 sorters: [
47 {
48 property: 'name',
49 direction: 'ASC',
50 },
51 ],
52 autoLoad: true,
53 },
54 });
55
56 me.callParent();
57 },
58});