mobile scheduler list view

In the list view of the scheduler, it seems it displays the events in the following one month only , using default(today).

//scheduler.config.init_date = new Date();

I would like to display all events in the list view, could this be done? or display the events +1/-1 months? How can I do that.

Hi Samson

I had a similar need, and it was answered in this thread

http://forum.dhtmlx.com/viewtopic.php?f=24&t=28591

Hope that helps you.

Hi btex,

Thanks for your help. I read your post and tried before.

scheduler.config.init_date = new Date(2013,2,1);

I do not have much knowledge on these. I tried this code can change the start date of the list, but whatever date I set, it only displays one month forward. Take this as an example, it will display the events from 1 Mar 2013 to 31 Mar 2013, however, events before or after this period will not be displayed.

$$("scheduler").setDate(new Date());

And this can set the date when the scheduler first loaded.

I would like to display events from 1 Feb 2013 to 31 Mar 2013 (two months) in the list view at the same time. I wonder If these two code can show that. Would you mind show me a simple code to do that?

I think the suggested solution is useful but I did not know how it works before.

Now, instead of displaying two months, my scheduler reload data when the selected date is changed. Here is my clumsy code, a simple reference for who are going do similar thing.

$$("scheduler").coreData.attachEvent("onChange",function(date){ if (date){ if (($$("scheduler").coreData.getValue()) == date){ var startDate = $$("scheduler").coreData.getValue(); $$("scheduler").data.silent(function(){ this.clearAll(); scheduler.config.init_date = new Date(startDate); $$("scheduler").load("php/schedule.php","json"); }); } } });

Thanks again!

Samson,

would like to display all events in the list view, could this be done?

The solution recommended by Btex is correct and allows to display all events in list view and preselect current date.

Now, instead of displaying two months, my scheduler reload data when the selected date is changed.

Where did you find this code snippet ? Btex recommended different approach.

Alexandra,

The solution recommended by Btex is correct and allows to display all events in list view and preselect current date.

um… maybe I cannot get how to implement for the solution recommended by Btex.

For my limited understanding, the code below only shows limited events but not all, starting from the stated date to one month after the stated date. And it does not change dynamically base on user needs. So I think of reloading the data.

scheduler.config.init_date = new Date(2012,0,1);

Where did you find this code snippet ? Btex recommended different approach.

I read your reply in this post http://forum.dhtmlx.com/viewtopic.php?f=24&t=22072
And change the code a bit to fit my application.

Though it solved my problem, I think this approach will increase the loading of database dramatically.

So, you want to change start date for scheduler dynamically… Am I right ?

In this case you can try the following approach:

scheduler.config.init_date = new Date(2012,0,1);
$$(“scheduler”).refresh();

Right.

Oh, I make simple thing complicated… it shows all the events by calling refresh()! thanks!

But I have developed something on that complicated code, and found a bug, which happened after update an event. It shows a blank detail page instead of feeding with event details. I think it is due to reload of the attachEvent onChange.

To solve this, I have to prevent it from going to $$(“scheduler”).load when the user clicked “save” after “edit” the event. May I know any method can prevent this to solve the problem?

Hi,

I have solved the problem by using the refresh() function :smiley: It looks nice !

Thanks Alexandra!