cellTemplate of TimelineYear is called multiple with same date

I have a schedule component showing the TimelineYear view. 

I have created a cellTemplate that colors all weekend days with a different color. 
For months, that do not begin or end at start or end of the row, invalid colorings can be shown. 
The cellTemplate is called multiple times with the same date, so within it I cannot distinguish if it is a "real" date, or a date from a previous month. 

See e.g. the month of may. The cellTemplate is called 6 times with a date of 05/01/2021. 
The cells before the correct 05/01 cell are marked as "e-other-month" in css, but I cannot access that within the template function. 



3 Replies 1 reply marked as answer

PN Praveenkumar Narasimhanaidu Syncfusion Team May 17, 2021 05:05 PM UTC

Hi Andreas, 
  
Greetings from Syncfusion support..! 
  
We have validated your reported problem and let you know that we can achieve your requirement using renderCell event. We have also prepared a sample for your reference which can be viewed from following link. 
  
  
App.vue 
onRenderCell: (args) => { 
      if ( 
        (args.elementType === "workCells" || 
        args.elementType === "monthCells") &&  
      !args.element.classList.contains('e-other-month') 
      ) { 
        let weekEnds = [0,6]; 
        if (weekEnds.indexOf(args.date.getDay()) >= 0) { 
          let ele = createElement("div", { 
            innerHTML: 
              "<img src='https://ej2.syncfusion.com/demos/src/schedule/images/newyear.svg' />", 
            className: "templatewrap", 
          }); 
          args.element.appendChild(ele); 
        } 
      } 
  
Kindly try the above solution and get back to us if you need any further assistance 
  
Regards, 
Praveenkumar 
 


Marked as answer

AK Andreas Kroll May 18, 2021 12:04 PM UTC

You are really awesome. 
Thank you so much for your help. It works like a charm!

I never had a company provide such a great support before. 

Best regards, 
   Andreas


NR Nevitha Ravi Syncfusion Team May 19, 2021 03:34 AM UTC

Hi Andreas, 

You are most welcome..! We are glad to hear that our solution worked at your end. Please be in touch with us for further assistance. We are always happy to assist you. 

Regards, 
Nevitha 


Loader.
Up arrow icon