Hide header row on specific view

Hi all!
I'm trying to hide the hour header row on my timelineday view, and show it on my timelineweek view, but it´s only working statically. Even reloading the schedule (with schedule.refresh() method after currentView gets updated) doesn't get these header rows to change. I´m leaving my code below:


    <ng-template #dateHeaderTemplate let-data>
        <div>{{getDateHeaderText(data.date)}}</div>
    </ng-template>
    <e-header-rows>        
        <e-header-row option="Date"></e-header-row>
        <e-header-row option="Hour" *ngIf="currentView === 'TimelineDay'"></e-header-row>
    </e-header-rows>


Some hints?


3 Replies

RV Ravikumar Venkatesan Syncfusion Team February 25, 2020 09:22 AM UTC

Hi Sergio, 

Greetings from Syncfusion support. 

Based on your requirement we have prepared the below sample by using the navigating event of Schedule like the below code and the same made in the sample. 

[app.component.html] 
    <ejs-schedule #scheduleObj width='100%' height='650px' [currentView]='currentView' (navigating)="onNavigating($event)"> 
      <e-header-rows> 
        <e-header-row option='Date'></e-header-row> 
        <e-header-row option='Hour'></e-header-row> 
      </e-header-rows> 
      <e-views> 
        <e-view option='TimelineDay'></e-view> 
        <e-view option='TimelineWeek'></e-view> 
        <e-view option='TimelineMonth'></e-view> 
      </e-views> 
    </ejs-schedule> 


[app.component.ts] 
  public onNavigating(args: NavigatingEventArgs) { 
    let dayView: boolean = args.action === 'view' ? args.currentView === 'TimelineDay' : this.scheduleObj.currentView === 'TimelineDay'; 
    this.scheduleObj.headerRows = dayView ? [{ option: 'Date' }] : [{ option: 'Date' }, { option: 'Hour' }]; 
  } 


Kindly try the above sample and let us know for further assistance on this. 


Regards, 
Ravikumar Venkatesan 



SE Sergio February 25, 2020 07:44 PM UTC

Great! Now it´s working as I expected. Thank you for your prompt reply :)


VM Vengatesh Maniraj Syncfusion Team February 26, 2020 08:48 AM UTC

Hi Sergio, 

You are most welcome. 

We are happy that the issue has resolved. 

Regards, 
Vengatesh 


Loader.
Up arrow icon