use correct api for add/edit/remove place; fix demo

This commit is contained in:
rolux 2011-05-30 11:09:52 +02:00
parent c99e7af1bd
commit 120a28eaa2
2 changed files with 4 additions and 4 deletions

View file

@ -48,9 +48,9 @@ Ox.load('Geo', function() {
var $listmap = new Ox.ListMap({ var $listmap = new Ox.ListMap({
addPlace: function(data, callback) { addPlace: function(data, callback) {
var id = Ox.encodeBase32(Ox.uid()); var id = Ox.encodeBase32(Ox.uid());
Ox.print('addplace', getGeonameSort(data.place.geoname)); Ox.print('addplace', getGeonameSort(data.geoname));
places.push(Ox.extend(data.place, { places.push(Ox.extend(data, {
geonameSort: getGeonameSort(data.place.geoname), geonameSort: getGeonameSort(data.geoname),
id: id id: id
})); }));
callback({ callback({

View file

@ -572,7 +572,7 @@ Ox.ListMap = function(options, self) {
} }
//that.triggerEvent('addplace', {place: place}); //that.triggerEvent('addplace', {place: place});
if (self.isAsync) { if (self.isAsync) {
self.options.addPlace({place: place}, function(result) { self.options.addPlace(place, function(result) {
place.id = result.data.id; place.id = result.data.id;
self.selectedPlace = place.id; self.selectedPlace = place.id;
self.$list.reloadList().options({selected: [place.id]}); self.$list.reloadList().options({selected: [place.id]});