twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

How can I add a delete event functionality ? #98

Closed Debdazeworks closed 8 years ago

Debdazeworks commented 8 years ago

How to add a 'X' symbol and onclick event to delete a calendar event?

twinssbc commented 8 years ago

@Debdazeworks Have a look at View Customization Options section in README. The calendar exposes some options to use your own template.

Debdazeworks commented 8 years ago

I have changed https://github.com/twinssbc/Ionic-Calendar/blob/master/templates/rcalendar/displayEvent.html file, but no change is reflected. Am I doing right?

twinssbc commented 8 years ago

So you directly modify the source code, in this case, you need to run grunt build-tpls to generate the dist file. Actually you dont need to modify source code, just provide an external template file and assign to weekviewNormalEventTemplateUrl.

Debdazeworks commented 8 years ago

I found "weekviewNormalEventTemplateUrl" in two places

  1. https://github.com/twinssbc/Ionic-Calendar/blob/master/dist/js/calendar-tpls.js
  2. https://github.com/twinssbc/Ionic-Calendar/blob/master/src/rcalendar/calendar.js

Where should I change ? I have downloaded the whole file in my local system and demo page is working. If I delete the templates\rcalendar\displayEvent.html in my file system, then also its working fine. How ?

twinssbc commented 8 years ago

@Debdazeworks you don't need to modify the source code. You just create your own template file, for example, myTemplate.html. When you declare the calendar, pass your own template to weekview-normal-event-template-url

<calendar ... weekview-normal-event-template-url="weekviewNormalEventTemplateUrl"></calendar>
$scope.weekviewNormalEventTemplateUrl = 'myTemplate.html';
Debdazeworks commented 8 years ago

Thanks a lot man. It works.... (Y)