scheduler clearAll

$$(“scheduler”).clearAll(); -
doesn’t work i have to close the app to see new data binding and use the code in this post viewtopic.php?f=24&t=27128&p=85826&hilit=clear#p85826 but doesn’t work with me

i keeping see the first object rendered to schedule , i need to rebind the schedule

scheduleService.GetReservations(function(data) {
            $.mobile.changePage("schedule.html");
            $('#sch').live('pageshow', function(event, ui) {
                var dateNow = new Date();

                scheduler.config.init_date = dateNow;
                scheduler.config.readonly = true;
                scheduler.config.scale_hour = "%h %i %a";
                scheduler.config.hour_date = "%h:%i %A";
                scheduler.config.item_date = "%m.%j.%Y";
                scheduler.xy.scale_height = 35;
                scheduler.config.show_loading = true;
                scheduler.xy.list_height = 90;
                scheduler.config.prevent_cache = true;
                dhx.Touch.enable();

                dhx.ui({
                    container: "sch",
                    view: "scheduler",
                    id: "scheduler"
                });

                $$("scheduler").$$("buttons").setValue("month");
                $$("scheduler").clearAll();
                $$("scheduler").parse(data, "json");

thanks

Hello,

if you want to destruct the existent scheduler and create the new one, you should use destructor() method and call scheduler init.

if($$("scheduler")) $$("scheduler").destructor(); ... dhx.ui({ container: "sch", view: "scheduler", id: "scheduler" }); $$("scheduler").$$("buttons").setValue("month"); $$("scheduler").parse(data, "json");

If you want to change only scheduler data, you need to call only clearAll() and parse method:

// init scheduler only if it is not created yet. if(!$$("scheduler")){ ... dhx.ui({ container: "sch", view: "scheduler", id: "scheduler" }); } // load data $$("scheduler").$$("buttons").setValue("month"); $$("scheduler").clearAll(); $$("scheduler").parse(data, "json");