Hello guys.
I need help with setting a value for ONE specific column once i create an event with the scheduler.
My query takes all the input from the lightbox form.
But i have a column called “svar”.
What I want to do is, once I create an event, i want to update the value of the column “svar” to 0.
The only way i know how to do this is to attatch a textarea in the lightbox and do map_to:svar, but then i have a field in the lightbox that i dont want.
I want to make the value “0” as soon as i create an event.
I want to make it 0 because i will later on have and accept/deny button in a backend app where accept will change the “svar” column to 1 and deny will change “svar” to 2.
0 = pending
1 = accepted
2 = denied
I have this.
scheduler.templates.event_bar_text = function(start,end,event){
if(event.svar == "0"){
event.text = "Pending";
}
else if(event.svar =="1"){
event.text = "Accepted";
}
else {
event.text = "Denied";
}
return event.text;
};
Now, this code works perfectly. If i manually change the “svar” value of two events in the database. one event to 0 and one event to 1, they will show the correct text. pending and accepted. So this code works and it does take the value from the DB.
I want to make it so whenever I create an event, i want the svar column for the event to be set to 0.
Everytime i create an event i get the text “Incorrect field name used: svar” in the log.
I guess since svar is in the query but nothing mapped to it.