diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 9c4ee043..b2ed3855 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -1319,7 +1319,7 @@ Ox.List = function(options, self) { // may break other things !self.isAsync && triggerSelectEvent(value); } else if (key == 'sort') { - Ox.print('---sort---') + //Ox.print('---sort---') updateSort(); } }; diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index d711d17b..27d34a37 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -288,7 +288,11 @@ Ox.TextList = function(options, self) { // so we use a timeout for now setTimeout(function() { that.$body.options({sort: self.options.sort}); - }, 10) + }, 10); + that.triggerEvent('sort', { + key: self.options.sort[0].key, + operator: self.options.sort[0].operator + }); } function constructHead() { @@ -694,10 +698,11 @@ Ox.TextList = function(options, self) { function updateOrder(id) { var pos = getColumnPositionById(id); - //Ox.print(id, pos) - that.$titles[pos].next().html(Ox.UI.symbols[ - 'triangle_' + (self.options.sort[0].operator == '+' ? 'up' : 'down') - ]); + if (pos > -1) { + that.$titles[pos].next().html(Ox.UI.symbols[ + 'triangle_' + (self.options.sort[0].operator == '+' ? 'up' : 'down') + ]); + } } self.setOption = function(key, value) {