]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
WEBUI JS: enum lists are sorted using case-insensitive type now
authorJaroslav Kysela <perex@perex.cz>
Wed, 1 Oct 2014 18:01:56 +0000 (20:01 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 1 Oct 2014 18:01:56 +0000 (20:01 +0200)
src/webui/static/app/chconf.js
src/webui/static/app/idnode.js

index d75b9419e3feeba1632a7a0770f776bcc2833206..1342e6411b5fe7ce24e05469cee6f687f4a5025d 100644 (file)
@@ -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) {
index 6104e9c3a72e973617176e608df6d30da8b09ea0..667186aacc1ed701ccd9ac2784f57fa416845517 100644 (file)
@@ -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 || {},