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',
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

View file

@ -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',