Paul-DS / bootstrap-year-calendar

[DEPRECATED] A fully customizable year calendar widget, for boostrap !
Apache License 2.0
294 stars 243 forks source link

how to use customDataSourceRenderer at setDataSouce ? #164

Open animaYundi opened 6 years ago

animaYundi commented 6 years ago
i have a customDataSourceRenderer and it works great at initiation. How can i make calendar use my customDataSourceRenderer at all setDataSource method calls ?

thanks.

William-H-M commented 6 years ago

HI, do you mean something like when you change the year that the customDataSourceRenderer is not being used or something like that? If it's use the event yearChanged

You can see it by example on #71 In case you don't see where's yearChanged event check #139

animaYundi commented 6 years ago

It's an event driven rendering in my case not related with years. I'm trying something like this;

 $('#calendar').calendar({
   customDataSource: aCustomEventSource,
   customDataSourceRenderer: function(element, date, events) {
     //some custom styling here
   }
})
//customDataSourceRendering succeeded.

.....

.somethingHappenedAtMyRuntime(function (){
    newCustomEventSource = $.get("/newEventList");
    $('#calendar').data('calendar').setDataSource(newCustomEventSource);
    //customDataSourceRendering failed!!
})