angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

Custom buttons in config not showing in calendar #328

Open rdeslonde opened 8 years ago

rdeslonde commented 8 years ago

Per the fullcalendar documentation (http://fullcalendar.io/docs/display/customButtons/) you can add buttons in the config. However trying this with their example doesn't work in the angular config.

Here's my config. Everything works except the custom button doesn't show up.

vm.uiConfig = { calendar: { editable: true, customButtons: { myCustomButton: { text: 'custom!', click: function() { alert('clicked the custom button!'); } } }, header: { left: 'month,agendaWeek,agendaDay prev,next today myCustomButton', center: 'title', right: 'subscribe' }, theme: false, eventSources: vm.eventSources, eventClick: vm.eventClick, dayClick: vm.dayClick } };

ldeavila commented 8 years ago

Funny. I just tried this myself and am also not seeing the custom button render.

ldeavila commented 8 years ago

Looks like custom buttons are a feature of the 2.4 version of fullcalendar. angular-ui-calendar installs version 2.3.1. Had to uninstall the version of fullcalendar installed by angular-ui-calendar and manually install fullcalendar.

bower uninstall fullcalendar bower install fullcalendar --save

Not sure if there will be incompatibilities. We will see!

rdeslonde commented 8 years ago

Interesting. Thanks Ideavila! Let me know if you see any issues.

rdeslonde commented 8 years ago

I guess the question here then would be when does the team plan on upgrading this to 2.4 of fullcalendar?

amaanr commented 8 years ago

^ Updated to latest version. All good.

leocaseiro commented 8 years ago

Update fullcalendar to 2.4.0 works great. If you are using bower, try:

bower install fullcalendar#2.4.0 --save

migvill commented 8 years ago

I created a PR for this issue. For now do the above solution of adding as a dependency. And also add it to resolutions to resolve any conflicts

  "dependencies": {
    "angular-ui-calendar": "1.0.1",
    "fullcalendar": "2.6.0"
  },
  "resolutions": {
    "fullcalendar": "2.6.0"
  }