add calendarevent form field

this is a freely editable combobox, which shows five usable examples and
their syntax, allowing users to deduct how the syntax works without
reading documentation

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-06-13 14:56:03 +02:00 committed by Dietmar Maurer
parent 1344537655
commit 56da921434
2 changed files with 35 additions and 0 deletions

View File

@ -71,6 +71,7 @@ JSSRC= \
form/QemuBiosSelector.js \
form/VMSelector.js \
form/USBSelector.js \
form/CalendarEvent.js \
dc/Tasks.js \
dc/Log.js \
panel/StatusPanel.js \

View File

@ -0,0 +1,34 @@
Ext.define('PVE.form.CalendarEvent', {
extend: 'Ext.form.field.ComboBox',
xtype: 'pveCalendarEvent',
editable: true,
valueField: 'value',
displayField: 'text',
queryMode: 'local',
store: {
field: [ 'value', 'text'],
data: [
{ value: '*/30', text: gettext("Every 30 minutes")},
{ value: '*/2:00', text: gettext("Every two hours")},
{ value: '2,22:30', text: gettext("02:30, 22:30")},
{ value: 'mon..fri', text: gettext("Monday to Friday 00:00")},
{ value: 'sun 01:00', text: gettext("Sunday 01:00")}
]
},
tpl: [
'<ul class="x-list-plain"><tpl for=".">',
'<li role="option" class="x-boundlist-item">{text}</li>',
'</tpl></ul>'
],
displayTpl: [
'<tpl for=".">',
'{value}',
'</tpl>'
]
});