PDA

View Full Version : [CLOSED] CalendarPanel Button Next, Previous with DateField



osef
Oct 09, 2013, 12:38 AM
Hi Team, I want the directevent to buttons previous and next of CalendarPanel, I am tring with DateChange but, when I give clic in the button day, week and month the event is fire, and I want when the clic my control DateField change its value.

My screen is as this:

7014

Regards

Baidaly
Oct 09, 2013, 1:30 AM
Hello!

I don't quite understand you but it seems you should call onNextClick method:



public void ButtonClick(object sender, DirectEventArgs e)
{
this.CalendarPanel1.Call("onNextClick");
}


To show previous period you can use onPrevClick


this.CalendarPanel1.Call("onPrevClick");

osef
Oct 09, 2013, 2:01 AM
Hello!

I don't quite understand you but it seems you should call onNextClick method:



public void ButtonClick(object sender, DirectEventArgs e)
{
this.CalendarPanel1.Call("onNextClick");
}


To show previous period you can use onPrevClick


this.CalendarPanel1.Call("onPrevClick");

I'am sorry Baidaly for my bad english or expression.

How Can I do to change the date of control DateField when I get to do click in the Buttons Previous and Next of CalendarPanel (where are buttons day, week, month) in the Day View?

Daniil
Oct 09, 2013, 3:47 AM
Hi,

Seems the functionality you need is presented in this example:
http://examples2.ext.net/#/Calendar/Overview/Basic/

Just there is a DatePicker instead of a DateField. But it doesn't matter.

A CalendarPanel's ViewChange event is being listened to.

<ViewChange Fn="CompanyX.viewChange" Scope="CompanyX" />

viewChange : function (p, vw, dateInfo) {
var win = this.getWindow();

if (win) {
win.hide();
}

if (dateInfo) {
// will be null when switching to the event edit form, so ignore
this.DatePicker1.setValue(dateInfo.activeDate);
this.updateTitle(dateInfo.viewStart, dateInfo.viewEnd);
}
}

Please note the setValue call on the DatePicker1.