scoutforpets / ember-fullcalendar

An Ember Component for FullCalendar and FullCalendar Scheduler
MIT License
39 stars 45 forks source link

[usage question] View Specific options #47

Closed Prabhakar-Poudel closed 7 years ago

Prabhakar-Poudel commented 7 years ago

How do we set view specific options ? I have tried few obvious approach but it does not effect the calendar anyway. Does the code has to be in specific place and is there any different approach to do the same?

I need something like this to be done:

Ember.$('.full-calendar').fullCalendar({
      views: {
        agendaWeek: {
          titleFormat: 'MMMM d, y',
          columnFormat: 'ddd D'
        }
      }
    });

Although I can achieve few things with viewRender callback. Checking the view.type and setting options in view.options. But unfortunately for above case the changes will reflect only in next subsequent render of the view, which is not doing me any good.

I have tried to get it initialized as above in all the component hooks to see if anything works, but had no luck with it. Am i missing something here?

jamesdixon commented 7 years ago

@Prabhakar-Poudel I currently do this in my own code by settings the views property of the component and it works as expected.

In all honesty, I can't seem to find this option in the documentation, but as I said, it does work and is worth a try. I don't have time to do a deep dive into it to see why it wouldn't be working when passed as an option.

Prabhakar-Poudel commented 7 years ago

Ahhh! That was silly of me not to think about it. Thanks! that should definitely work.