This topic contains 4 replies, has 2 voices, and was last updated by Todor 5 years, 8 months ago.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
jQuery UI Widgets › Forums › Scheduler › Create custom editDialog
This topic contains 4 replies, has 2 voices, and was last updated by Todor 5 years, 8 months ago.
I read in other answer that it is not possible to overwrite your editDialog but I needeed different fields so this is what I did:
First of all I set editDialog: false
After that, on the appointmentDoubleClick event, I open my custom window and I set all my fields one by one with the appointment object data and everything works.
Can you suggest a better(cleaner) solution?
Now I want to do the same thing when I create a new appointment. I create my custom window in the contextMenuItemClick event (item.id=createAppointment) but here’s the problem. How can I get the start time and the end time based on my selection?
Suggestions?
Hello clock84,
You have to use cellClick or cellDoubleClick event to be able to get the cell’s date.
$("#scheduler").on('cellClick', function (event) {
var args = event.args;
var cell = args.cell;
var dateObject = new $.jqx.date($(cell).attr('data-date')).toDate();
console.log("start date >>" + dateObject);
});
Let us know if you need further assistance.
Best Regards,
Todor
jQWidgets Team
https://www.jqwidgets.com
Thank you Todor.
I needed also the end date so I finally used this code:
if (selection !== null) {
selectionDateFrom = selection.from;
selectionDateTo = selection.to;
}
Hello clock84,
You can calculate the end date. Please review the example below:
$("#scheduler").on('cellClick', function (event) {
var args = event.args;
var cell = args.cell;
var differenceInMinutes = 30;
var selectionDateFrom = new $.jqx.date($(cell).attr('data-date')).toDate();
var selectionDateTo = new Date(selectionDateFrom.getTime() + differenceInMinutes * 60 * 1000);
});
Let us know if you need further assistance.
Best Regards,
Todor
jQWidgets Team
https://www.jqwidgets.com
You must be logged in to reply to this topic.