1
0
Fork 0
forked from 0x2620/oxjs

add type field (still needs a better Ox.Select)

This commit is contained in:
rolux 2011-05-30 13:47:30 +02:00
commit 60662a437a
4 changed files with 130 additions and 26 deletions

View file

@ -104,6 +104,16 @@ Ox.ListMap = function(options, self) {
visible: true,
width: 192
},
{
format: function(value) {
return Ox.toTitleCase(value);
},
id: 'type',
operator: '+',
title: 'Type',
visible: true,
width: 64
},
{
align: 'right',
format: toFixed,
@ -181,7 +191,7 @@ Ox.ListMap = function(options, self) {
operator: '-',
title: 'Date Created',
visible: false,
width: 192,
width: 128,
},
{
format: function(value) {
@ -191,7 +201,7 @@ Ox.ListMap = function(options, self) {
operator: '-',
title: 'Date Modified',
visible: false,
width: 192,
width: 128,
},
{
align: 'right',
@ -291,7 +301,10 @@ Ox.ListMap = function(options, self) {
self.$placeForm.values(data).show();
},
changeplaceend: function(data) {
editPlace(['lat', 'lng', 'south', 'west', 'north', 'east', 'area']);
var isResult = self.selectedPlace.id[0] == '_';
!isResult && editPlace([
'lat', 'lng', 'south', 'west', 'north', 'east', 'area'
]);
},
geocode: function(data) {
that.triggerEvent('geocode', data);
@ -355,6 +368,24 @@ Ox.ListMap = function(options, self) {
self.$map.value(self.selectedPlace, 'name', data.value);
}
}),
Ox.ArrayInput({
id: 'alternativeNames',
label: 'Alternative Names',
max: 10,
//sort: true,
values: [],
width: 240
}).bindEvent({
change: function(data) {
var isResult = self.selectedPlace[0] == '_';
if (!self.isAsync) {
} else {
!isResult && editPlace(['alternativeNames'])
}
self.$map.value(self.selectedPlace, 'alternativeNames', data.value);
}
}),
Ox.Input({
id: 'geoname',
label: 'Geoname',
@ -366,7 +397,6 @@ Ox.ListMap = function(options, self) {
country = Ox.getCountryByGeoname(geoname),
countryCode = country ? country.code : '',
isResult = self.selectedPlace[0] == '_';
//self.$map.value(self.selectedPlace, 'geoname', geoname);
self.$placeTitleFlag.attr({
src: Ox.getImageByGeoname('icon', 16, geoname)
});
@ -387,12 +417,20 @@ Ox.ListMap = function(options, self) {
Ox.Input({
id: 'countryCode'
}).hide(),
Ox.ArrayInput({
id: 'alternativeNames',
label: 'Alternative Names',
max: 10,
//sort: true,
values: [],
Ox.Select({
id: 'type',
items: [
{id: 'country', title: 'Country'},
{id: 'region', title: 'Region'},
{id: 'city', title: 'City'},
{id: 'borough', title: 'Borough'},
{id: 'street', title: 'Street'},
{id: 'premise', title: 'Premise'},
{id: 'feature', title: 'Feature'},
{id: 'other', title: 'Other'}
],
label: 'Type',
labelWidth: 64,
width: 240
}).bindEvent({
change: function(data) {
@ -400,11 +438,11 @@ Ox.ListMap = function(options, self) {
if (!self.isAsync) {
} else {
!isResult && editPlace(['alternativeNames'])
!isResult && editPlace(['type'])
}
self.$map.value(self.selectedPlace, 'alternativeNames', data.value);
self.$map.value(self.selectedPlace, 'type', data.selected[0]);
}
}),
})
], ['South', 'West', 'North', 'East', 'Latitude', 'Longitude'].map(function(v) {
var id = (
v == 'Latitude' ? 'lat' : v == 'Longitude' ? 'lng' : v
@ -420,10 +458,6 @@ Ox.ListMap = function(options, self) {
max: max,
type: 'float',
width: 240
}).bindEvent({
focus: function() {
Ox.print('---- FOCUS ----')
}
});
}), [
self.$areaInput = Ox.Input({