1
0
Fork 0
forked from 0x2620/oxjs

better behaviour when editing (only send changed key/value pairs, only reload list if sort order is affected)

This commit is contained in:
rolux 2011-05-30 08:54:45 +02:00
commit 1eebdf3805
2 changed files with 16 additions and 10 deletions

View file

@ -60,8 +60,11 @@ Ox.load('Geo', function() {
},
editPlace: function(data, callback) {
var place = Ox.getObjectById(places, data.id);
place = Ox.extend(place, data, {
geonameSort: getGeonameSort(data.geoname)
Ox.forEach(data, function(value, key) {
place[key] = value;
if (key == 'geoname') {
place.geonameSort = getGeonameSort(place.geoname);
}
});
callback({
result: {code: 200, text: 'OK'}