use 'sort' property, not 'map' property, for custom sort in table lists (fixes #993)

This commit is contained in:
rlx 2012-09-19 06:46:44 +00:00
parent 03520f6b2e
commit a392cad0bc
2 changed files with 17 additions and 17 deletions

View file

@ -107,20 +107,20 @@ Ox.CalendarEditor = function(options, self) {
}, },
{ {
id: 'start', id: 'start',
map: function(value) { operator: '-',
sort: function(value) {
return Ox.parseDate(value); return Ox.parseDate(value);
}, },
operator: '-',
title: 'Start', title: 'Start',
visible: true, visible: true,
width: 144 width: 144
}, },
{ {
id: 'end', id: 'end',
map: function(value) { operator: '-',
sort: function(value) {
return Ox.parseDate(value); return Ox.parseDate(value);
}, },
operator: '-',
title: 'End', title: 'End',
visible: true, visible: true,
width: 144 width: 144
@ -136,10 +136,10 @@ Ox.CalendarEditor = function(options, self) {
return self.durationCache[key]; return self.durationCache[key];
}, },
id: 'id', id: 'id',
map: function(value, data) { operator: '-',
sort: function(value, data) {
return Ox.parseDate(data.end) - Ox.parseDate(data.start); return Ox.parseDate(data.end) - Ox.parseDate(data.start);
}, },
operator: '-',
title: 'Duration', title: 'Duration',
visible: true, visible: true,
width: 256 width: 256

View file

@ -93,15 +93,15 @@ Ox.MapEditor = function(options, self) {
: ''; : '';
}, },
id: 'countryCode', id: 'countryCode',
map: function(value) { operator: '+',
resizable: false, // fixme: implement
sort: function(value) {
var names = value.split(', '); var names = value.split(', ');
if (!Ox.getCountryByGeoname(names[names.length - 1])) { if (!Ox.getCountryByGeoname(names[names.length - 1])) {
names.push('~'); names.push('~');
} }
return names.reverse().join(', '); return names.reverse().join(', ');
}, },
operator: '+',
resizable: false, // fixme: implement
title: 'Flag', title: 'Flag',
titleImage: 'flag', titleImage: 'flag',
tooltip: function(data) { tooltip: function(data) {
@ -169,17 +169,17 @@ Ox.MapEditor = function(options, self) {
}, },
{ {
id: 'geoname', id: 'geoname',
map: function(value) { operator: '+',
sort: function(value) {
var names = value.split(', '); var names = value.split(', ');
if (!Ox.getCountryByGeoname(names[names.length - 1])) { if (!Ox.getCountryByGeoname(names[names.length - 1])) {
names.push('~'); names.push('~');
} }
return names.reverse().join(', '); return names.reverse().join(', ');
}, },
operator: '+', title: 'Geoname',
title: 'Geoname', visible: false,
visible: false, width: 192
width: 192
}, },
{ {
align: 'right', align: 'right',