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

How to input x button in event when i use CssClassPrefix?

Asked by nok
8 years ago.

hi,

i set
EventDeleteHandling="JavaScript"
EventDeleteJavaScript="eventDelete(e)"
in Calendar and Month, ASP.NET WebForms
and it works in default css mode.(CssOnly=false)

but when i use CssClassPrefix(CssOnly=true), i cant see x button in event.

how to appear this button?
i used calendar_blue.css.

thanks.

Answer posted by Dan Letecky [DayPilot]
8 years ago.

The delete icon is not supported in the CssOnly mode. It is replaced by more universal system of "active areas". You can add the delete button using BeforeEventRender:

protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
  e.Areas.Add(new Area().Right(3).Top(3).Width(15).Height(15).CssClass("event_action_delete").JavaScript("dpc1.eventDeleteCallBack(e);"));
}

Don't forget to include areas.css from Themes directory.

<link type="text/css" href='Themes/areas.css' rel="stylesheet" />
Comment posted by nok
8 years ago.

thanks dan, area worked.

but when i click delete area, click event is also executed.

how to execute only delete event when i click delete area?
how to ignore other event in delete area?

thank you

Comment posted by nok
8 years ago.

oh i dont know what i did but that is working correctly.

i think there is someting syntax error.

thanks!

Comment posted by Dan Letecky [DayPilot]
8 years ago.

You need to set ClientObjectName to "dpc1". The example is using a reference to the DayPilot.Calendar client-side object to invoke the EventDelete event.

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