search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

HeaderClickHandling not working properly

Asked by Roday
15 years ago.

I have set the following parameter:

HeaderClickHandling="JavaScript"

The 'standard' javascript is defined as:

alert('Header with id ' + c.value + ' clicked.')

The alert however, alwaysreturns null for c.value (Header with id null clicked. is the exact alert message)

I tried to change the 'c' for 'e' which sounds more appropriate to me. Unfortunately that only made things worse (e is not defined error).

The behaviour I want to achieve is that when multiple days are listed, clicking on a column will give me that single day full screen. But as long as I cannot get back the clicked date from the column, this appears very difficult to do :-)

Comment posted by Dan B
15 years ago.

This works for me..

protected void DayPilotCalendar1_HeaderClick(object sender, DayPilot.Web.Ui.Events.HeaderClickEventArgs e)
{
//user clicks on header - switch view

switch(DayPilotCalendar1.Days)
{
case 7:
DayPilotCalendar1.StartDate = e.Date;
DayPilotCalendar1.Days = 1;
DayPilotNavigator1.SelectMode = NavigatorSelectMode.Day;
DayPilotNavigator1.SelectionStart = e.Date;
break;
case 1:
DayPilotCalendar1.StartDate = e.Date;
DayPilotCalendar1.Days = 7;
DayPilotCalendar1.StartDate = DayPilot.Utils.Week.FirstWorkingDayOfWeek(DayPilotCalendar1.StartDate);
DayPilotNavigator1.SelectMode = NavigatorSelectMode.Week;
DayPilotNavigator1.SelectionStart = e.Date;
break;
}
DayPilotCalendar1.Update(CallBackUpdateType.Full);
}
Comment posted by Dan Letecky
15 years ago.

This is a bit underdocumented area:

It is indeed c variable (DayPilotCalendar.Column object) that has three properties:

  • value - the resource, not available unless you have defined your columns manually (ViewType="Resources") in Columns collecttion and assigned Column.Value
  • date - this is the date of the column - a value which you are looking for (Column.Date)
  • name - column name (Column.Name)

If you are using ViewType="Days" (default) you don't get in contact with Columns collection, it's generated internally.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.