jQWidgets Forums
Forum Replies Created
-
Author
-
September 13, 2016 at 5:25 pm in reply to: editDialogOpen – fill input fields editDialogOpen – fill input fields #87308
Hi
I found the solution by looking at the source code. The problem is that when you hover an appointment, it gets the element from appointmentsByKey from the scheduler obj.
The solution is the change the key to the new ID of that element. and it should work.
EX:
$(“#scheduler”).on(‘appointmentAdd’, function (event) {
var args = event.args;
var appointment = args.appointment;var new_key = ‘d9’;
var old_key = appointment.id;if (old_key !== new_key) {
Object.defineProperty(appointment.jqxAppointment.scheduler.appointmentsByKey, new_key,
Object.getOwnPropertyDescriptor(appointment.jqxAppointment.scheduler.appointmentsByKey, old_key));
delete appointment.jqxAppointment.scheduler.appointmentsByKey[old_key];
}appointment.id = appointment.jqxAppointment.id = appointment.originalData.ID = ‘d9’;
console.log(“appointmentAdd is raised”);
});Hope it helps.
September 12, 2016 at 8:21 pm in reply to: editDialogOpen – fill input fields editDialogOpen – fill input fields #87284FYI: Basically this is what I want to achieve.
allow user to add a new appointment by clicking the save button in the dialog, then do ajax call in the ‘appointmentAdd’ method and return a ID and assign it back to the appointment that just created, so it can be used for editing and deleting etc.
Since the method “appointmentAdd” is the only place it triggers when user click the save button, the ajax call has to be placed under this method, and no matter the call is failed or success, it creates the appointment anyway.
Any suggestion on where should I place my ajax call?
My thought of another solution is to use the method “addAppointment” with overwriting the save button when dialog open, then do the ajax call, if success then do the “addAppointment”.
Thoughts? suggestions?
Thanks you so much JQwidget team, keep up the good work.
September 12, 2016 at 7:51 pm in reply to: editDialogOpen – fill input fields editDialogOpen – fill input fields #87283Hi Hristo,
I am experiencing the same problem. Based on your previous example. https://www.jseditor.io/?key=jqxscheduler-edit-change-appointment-id
It works fine after changing the appointment.id = ‘d9’; But when you drag the appointment to change the date or time range, it automatically change the id from ‘d9’ back to the original auto generated id EX: ‘2716-26-25-17-23’
Any thought?
Thanks
June 23, 2016 at 4:34 pm in reply to: make 2 calls to the server to get data? make 2 calls to the server to get data? #85392Oh now I got it.
Thank you so much.
June 23, 2016 at 12:50 pm in reply to: make 2 calls to the server to get data? make 2 calls to the server to get data? #85388Hi Peter,
Thanks for your reply. I am just wondering in terms of performance, is there any way to make only one call to the server? So far, I can only think of doing a separate Ajax call then assign to the localdata property inside the source file.
Also, what resources and sources are used for? what data are they populated? Correct me if I am wrong, resources is used for legend, different types of color for each appointment, and sources is for the actual appointment data.
Once again, thanks for your reply.
Best regards,
Jack
-
AuthorPosts