Hi,
I would like to enable the edit series button and trigger the custom function on it in the Quick window (according to screen in attachments). Could you please help me with this issue?
HTML code of schedule:
<ej-schedule id="RidesSchedule"
e-allowDragAndDrop="false"
e-enableAppointmentResize="false"
e-locale="cs-CZ"
e-width="100%"
e-height="525px"
e-orientation="horizontal"
e-currentdate="vm.viewDate"
e-views="vm.views"
e-currentview="vm.calendarView"
e-group="vm.group"
e-appointmentEditSeriesButtonClicked ="vm.validateRide" - How to set custom function on the button??
e-appointmentWindowOpen="vm.editEvent"
e-appointmentClick="vm.editPopup"
e-appointmentRemoved="vm.onAppointmentRemoved"
e-cellClick="vm.editEvent"
e-timeMode="24"
e-appointmentsettings-datasource="vm.rides"
e-appointmentsettings-id="rideId"
e-appointmentsettings-resourcefields="vehicleId"
e-appointmentsettings-subject="subject"
e-appointmentsettings-starttime="startsAt"
e-appointmentsettings-endtime="endsAt"
e-appointmentsettings-description="description"
e-appointmentsettings-applytimeoffset="false"
e-appointmentsettings-allday="allDay"
e-appointmentsettings-recurrence="recurrence"
e-appointmentsettings-recurrencerule="recurrenceRule">
<e-resources>
<e-resource e-allowmultiple="false" e-field="vehicleId" e-title="Vehicle" e-name="Vehicles" e-resourcesettings="vm.vehicleResourcedata"></e-resource>
</e-resources>
</ej-schedule>
JS Angular controller:
(function () {
"use strict";
angular
.module("app-rides")
.controller("calendarController", calendarController);
function calendarController($http) {
var vm = this;
vm.editPopup = function (args) {
if (args.appointment.rideState == 1) { //enable and set text on edit series button
$("div.e-editseries").text("schválit jízdu");
$("div.e-editseries").removeClass("e-disable");
} else {
$("div.e-editseries").hide();
}
$("div.e-editevent").text("editovat jízdu");
$("#RidesSchedule_quickAppDetailswindow").find(".e-rightfields").hide();
}
//function to be triggered after click on edit series button
vm.validateRide = function(args) {
$http.put("api/rides/" + args.appointment.rideId, 2)
.then(function(response) {
//success
var msg = "Jízda s čislem " + response.data.rideId + " byla upravena.";
$location.path("/", msg).search({ msg: msg });
},
function(error) {
//failure
vm.errorMessage = "Failed to save changes in ride nr." + vm.ride.rideId + ": " + error;
});
}
})();
Attachment:
QuickWindow_877aca51.rar