jQuery UI Widgets › Forums › Scheduler › Changing view programmatically
This topic contains 14 replies, has 6 voices, and was last updated by Hristo 4 years, 6 months ago.
-
Author
-
I want to be able to change the view when the user double clicks a day. However, there is nothing in your public API that implements this. I’ve noticed that the ‘view’ property never changes past initial setup of the Scheduler. Is this a bug? You can test by setting an alert inside cellDoubleClick to test jqxScheduler(‘view’).
Hello Pfhoenix,
Please, take a look at this demo:
https://www.jseditor.io/?key=scheduler-change-view-programmatically
It seems to work fine.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comAnd if I want to only change the view if the user double clicks a day from the month view? Try checking the value of view when the user interacts only with the view changing buttons at the top of the scheduler.
Hello Pfhoenix,
Could you clarify what you mean?
It will be better to provide an example to demonstrate your points of view.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comI want to be able to double click on a day in the month view and have it switch to the day view for that day. The problem right now is knowing when the scheduler is in month view. You can check the value for $(‘#Scheduler’).jqxScheduler(‘view’), but it doesn’t change when the user interacts with the view changing buttons at the top of the scheduler.
Hello Pfhoenix,
You could bind to ‘viewChange’ event to get information about the new and the old views.
$('#scheduler').on('viewChange', function (event) { var args = event.args; var date = args.date; var from = args.from; var to = args.to; var oldViewType = args.oldViewType; var newViewType = args.newViewType console.log("oldViewType - " + oldViewType + "; newViewType - " + newViewType); });
Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHi,
I tried the demo (https://www.jseditor.io/?key=scheduler-change-view-programmatically), but it only seems to work once.
After having changed the view to ‘weekView’ via the cellDoubleClick eventhandler and then having changed it back to e.g. dayView using the top-right buttons using the cell double click again to change to weekView does not work anymore. I see the log message ‘cellDoubleClick is raised’, but the view stays in dayView.Can you look into this? I need this functionality to keep the view of two different instances of the scheduler in sync (the two instances have different sets of appointment fields).
Thanks!
Hello rjportier,
Thank you for the feedback.
I would like to suggest you look at these demos:
https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxscheduler/scheduler-resources.htm?light
https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxscheduler/scheduler-vertical-resources.htm?light
If it is possible to use it as a workaround.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comRunning this demo (https://jseditor.io/?key=scheduler-change-view-programmatically) you are only able to switch from month to week once. When you click back to Month, it won’t switch back to the week view when double clicked. When I attempted to use this code:
$(‘#scheduler’).on(‘viewChange’, function (event) {
var args = event.args;
var date = args.date;
var from = args.from;
var to = args.to;
var oldViewType = args.oldViewType;
var newViewType = args.newViewType
console.log(“oldViewType – ” + oldViewType + “; newViewType – ” + newViewType);
});I end up in a loop that requires closing the browser to break.
Any ideas how to fix this?
THanks
GregHello Greg,
I would like to mention that about the changing the view when use double-click it is not a good approach.
Also, this scenario is strange, because you click on one cell and after that change the view. Which will be the cell that you want to add/edit an appointment.
I tested this example and it seems to work fine:
https://www.jseditor.io/?key=99973a33124811e8b79e00224d6bfcd5Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comOk, I updated the example to show more what I am talking about. https://www.jseditor.io/?key=652b1e0c127111e8b79e00224d6bfcd5-ver-3
I agree, double clicking isn’t a good approach, so I just check cell click. What I am trying to do, when in month mode, clicking a cell takes you to a week view. The first time I click a day on the month view, it switches to the week view, the problem happens when the view is manually switched back to the month view using the month button in the upper right and another day is clicked. It is at this point where the click event fires but the view won’t change to the week view. The only way to fix this is to restart the page. The reason I am doing this, in the app I am working on, appointments can only be viewed in the month view, you click into the week or day to add/edit/delete appointments because they are date/time appointments and not just a day appointment.
Thanks again!
GregHello Greg,
Thank you for this feedback.
I will create a work item for this case.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHello Hristo
Please let us know if this is fixed with the latest release or when would this be fixed ?
Thanks,
Hello Hristo.
Please I want to know if this has already been solved, I need to implement this functionality.
Thanks!
Hello vanessa_bautista,
I will check the status of this issue and I will update it.
Thank you for your understanding.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.