Good morning, I am attempting to set a condition within the addEvent(obj) using the MyBackend class. I am attempting to save the event information to my database table only after a new event is entered. Here is the code snippet:
addEvent(obj) {
// This query should only fire when a new event is entered, but fires when the page loads causing an error due to the 'obj' being empty when page loads
<cfquery datasource="#MyDataSource#">
INSERT INTO gup_calendar_events(start_date, end_date, text, details, color, section, calendar)
VALUES(obj.start_date, obj.end_date, obj.text, obj.details, obj.color, obj.section, obj.calendar)
</cfquery>
// Used to test objects data, this alert only fires when a new event is entered
alert('Start Date: ' + obj.start_date + ', End Date: ' + obj.end_date + ', Text: ' + obj.text + ', Parameters: ' + obj.params);
return webix.promise.resolve(obj);
}