diff --git a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js index f041269a..4a0f1342 100644 --- a/source/Ox.UI/js/Calendar/Ox.ListCalendar.js +++ b/source/Ox.UI/js/Calendar/Ox.ListCalendar.js @@ -474,13 +474,17 @@ Ox.ListCalendar = function(options, self) { event.end = Ox.formatDate(endTime, '%Y-%m-%d %H:%M:%S', true); Ox.print(event); self.options.addEvent(event, function(result) { - event.id = result.data.id; - self.options.events.push(event); - var time0 = +new Date() - self.$list.options({items: Ox.clone(self.options.events, true)}); - Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0); - self.$calendar.addEvent(event); - selectEvent(event); + if (result.status.code == '200') { + event.id = result.data.id; + self.options.events.push(event); + var time0 = +new Date() + self.$list.options({items: Ox.clone(self.options.events, true)}); + Ox.print('TIME TO SET LIST OPTIONS:', +new Date() - time0); + self.$calendar.addEvent(event); + selectEvent(event); + } else { + alert(result.status.code) + } }); } @@ -488,9 +492,9 @@ Ox.ListCalendar = function(options, self) { var id = self.selectedEvent, index = Ox.getPositionById(self.options.events, id), data = {id: id}; + data[key] = value; self.options.editEvent(data, function(result) { self.options.events[index][key] = value; - data[key] = value; self.$list.value(id, key, value); if (['name', 'type', 'start', 'end'].indexOf(key) > -1) { self.$calendar.editEvent(id, key, value); diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 3aa38bba..3c085dd6 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -1178,6 +1178,7 @@ Ox.List = function(options, self) { // fixme: no case where callback is set // note: can't use selectNone here, // since it'd trigger a select event + Ox.print('SET SELECTED', ids) var counter = 0; self.$items.forEach(function($item, pos) { if (isSelected(pos)) {