webui: added support for enumerated types in the editor panel

This commit is contained in:
Adam Sutton 2013-06-10 13:44:36 +01:00
parent 181e925313
commit 2abe546e32

View file

@ -22,12 +22,27 @@ tvheadend.idnode_editor = function(item)
var d = f.rdonly || false; var d = f.rdonly || false;
switch(f.type) { switch(f.type) {
case 'str': case 'str':
fields.push({ if (f.enum) {
fieldLabel: f.caption, fields.push(new Ext.form.ComboBox({
name: f.id, fieldLabel: f.caption,
value: f.value, name: f.id,
disabled: d value: f.value,
}); mode: 'local',
disabled: d,
store: f.enum,
typeAhead: true,
forceSelection: true,
triggerAction: 'all',
emptyText:'Select ' + f.caption +' ...'
}));
} else {
fields.push({
fieldLabel: f.caption,
name: f.id,
value: f.value,
disabled: d
});
}
break; break;
case 'bool': case 'bool':