How to get data into lightbox select option and when we change option how should it update in db.
$.get("/api/hrm/leaves/", function(data) {
gantt.parse({‘data’:data});
gantt.refreshData()
});
this is the api iam using for getting data.
gantt.config.lightbox.sections = [
{name: “reason”, height: 38, map_to: “reason”, type: “template”, focus: true},
{
name: “leave_status”, height: 42,map_to: “leave_status”,type: “select”,options:gantt.serverList(“leave_status”)
},
];
api format:
{
“id”: 7,
“employee”: {
“id”: 1,
“employee_id”: “1101”,
“photo”: “/media/profiles/photo/admin.jpg”,
“nick_name”: “Nari”,
“official_name”: “Narendar”,
“department”: {
“id”: 1,
“name”: “RND”
},
“designation”: {
“id”: 1,
“name”: “Software Developer”
},
“location”: {
“id”: 1,
“name”: “Chennai”
}
},
“reason”: “Going to Home”,
“duration”: 3.0,
“applied_date”: “2019-02-19”,
“start_date”: “2019-03-19”,
“end_date”: “2019-03-21”,
“notes”: null,
“leave_type”: {
“id”: 2,
“name”: “Casual Leave”
},
“leave_status”: {
“id”: 3,
“name”: “Rejected”
}
}
first is how to get leave_status name in select options format,
second is how to update when an option in changed in lightbox.