diff --git a/src/webui/static/app/chconf.js b/src/webui/static/app/chconf.js index d75b9419..1342e641 100644 --- a/src/webui/static/app/chconf.js +++ b/src/webui/static/app/chconf.js @@ -31,26 +31,13 @@ insertChannelClearOption = function( scope, records, options ){ scope.insert(0,new placeholder({key: '-1', val: '(Clear filter)'})); }; -tvheadend.channels = new Ext.data.JsonStore({ +tvheadend.channels = tvheadend.idnode_get_enum({ url: 'api/channel/list', - root: 'entries', - fields: ['key', 'val'], - id: 'key', - autoLoad: true, - sortInfo: { - field: 'val', - direction: 'ASC' - }, listeners: { 'load': insertChannelClearOption } }); -tvheadend.comet.on('channels', function(m) { - if (m.reload != null) - tvheadend.channels.reload(); -}); - tvheadend.channel_tab = function(panel, index) { function decode_dot_number(number) { diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 6104e9c3..667186aa 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -21,7 +21,14 @@ tvheadend.idnode_get_enum = function(conf) root: conf.root || 'entries', url: conf.url, baseParams: conf.params || {}, - fields: conf.fields || ['key', 'val'], + fields: conf.fields || + [ + 'key', + { + name: 'val', + sortType: Ext.data.SortTypes.asUCString + } + ], id: conf.id || 'key', autoLoad: true, listeners: conf.listeners || {},