calendar remove event
This commit is contained in:
@@ -352,6 +352,10 @@ Espo.define('Crm:Views.Calendar.Calendar', 'View', function (Dep) {
|
||||
this.$calendar.fullCalendar('updateEvent', event);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
removeModel: function (model) {
|
||||
this.$calendar.fullCalendar('removeEvents', model.name + '-' + model.id);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
@@ -84,7 +84,7 @@ Espo.define('Crm:Views.Calendar.Modals.Edit', 'Views.Modals.Edit', function (Dep
|
||||
$buttons.addClass('disabled');
|
||||
model.destroy({
|
||||
success: function () {
|
||||
this.trigger('after:remove', model);
|
||||
this.trigger('after:destroy', model);
|
||||
dialog.close();
|
||||
}.bind(this),
|
||||
error: function () {
|
||||
@@ -105,7 +105,7 @@ Espo.define('Crm:Views.Calendar.Modals.Edit', 'Views.Modals.Edit', function (Dep
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
this.once('after:remove', function (model) {
|
||||
this.once('after:destroy', function (model) {
|
||||
var parentView = this.getParentView();
|
||||
parentView.removeModel.call(parentView, model);
|
||||
}.bind(this));
|
||||
|
||||
Reference in New Issue
Block a user