From a392cad0bce79f3e27966d12d763012fa8c8e190 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 19 Sep 2012 06:46:44 +0000 Subject: [PATCH] use 'sort' property, not 'map' property, for custom sort in table lists (fixes #993) --- source/Ox.UI/js/Calendar/CalendarEditor.js | 12 ++++++------ source/Ox.UI/js/Map/MapEditor.js | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/Ox.UI/js/Calendar/CalendarEditor.js b/source/Ox.UI/js/Calendar/CalendarEditor.js index abb832b3..916e22fb 100644 --- a/source/Ox.UI/js/Calendar/CalendarEditor.js +++ b/source/Ox.UI/js/Calendar/CalendarEditor.js @@ -107,20 +107,20 @@ Ox.CalendarEditor = function(options, self) { }, { id: 'start', - map: function(value) { + operator: '-', + sort: function(value) { return Ox.parseDate(value); }, - operator: '-', title: 'Start', visible: true, width: 144 }, { id: 'end', - map: function(value) { + operator: '-', + sort: function(value) { return Ox.parseDate(value); }, - operator: '-', title: 'End', visible: true, width: 144 @@ -136,10 +136,10 @@ Ox.CalendarEditor = function(options, self) { return self.durationCache[key]; }, id: 'id', - map: function(value, data) { + operator: '-', + sort: function(value, data) { return Ox.parseDate(data.end) - Ox.parseDate(data.start); }, - operator: '-', title: 'Duration', visible: true, width: 256 diff --git a/source/Ox.UI/js/Map/MapEditor.js b/source/Ox.UI/js/Map/MapEditor.js index 253938f2..f8349f5e 100644 --- a/source/Ox.UI/js/Map/MapEditor.js +++ b/source/Ox.UI/js/Map/MapEditor.js @@ -93,15 +93,15 @@ Ox.MapEditor = function(options, self) { : ''; }, id: 'countryCode', - map: function(value) { + operator: '+', + resizable: false, // fixme: implement + sort: function(value) { var names = value.split(', '); if (!Ox.getCountryByGeoname(names[names.length - 1])) { names.push('~'); } return names.reverse().join(', '); }, - operator: '+', - resizable: false, // fixme: implement title: 'Flag', titleImage: 'flag', tooltip: function(data) { @@ -169,17 +169,17 @@ Ox.MapEditor = function(options, self) { }, { id: 'geoname', - map: function(value) { + operator: '+', + sort: function(value) { var names = value.split(', '); if (!Ox.getCountryByGeoname(names[names.length - 1])) { names.push('~'); - } - return names.reverse().join(', '); - }, - operator: '+', - title: 'Geoname', - visible: false, - width: 192 + } + return names.reverse().join(', '); + }, + title: 'Geoname', + visible: false, + width: 192 }, { align: 'right',