This is a migrated thread and some comments may be shown as answers.

MultiDayViewComponent: setting table column width

1 Answer 219 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ruben
Top achievements
Rank 2
Ruben asked on 09 Oct 2019, 07:59 AM

I am using the MultiDayView component and need to see 60 days ahead. What the component does now is put all those 60 days into the total width of the scheduler (without horizontal scrollbar). Is there a way to influence the column width of the day and automatically create an overflow with horizontal scrollbar?

 

 

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 11 Oct 2019, 07:13 AM

Hi Ruben,

In order to enable a horizontal scrollbar, the Scheduler slots width should be set. Using the [slotClass] function of the MultiDayView component we can apply any custom styles to each slot of the table.

However, with the above approach, the day slot width is not affected. I am afraid that there is no built-in option to set the width of the day table, but using some custom CSS code we can achieve the desired layout:

      .k-scheduler-table th {
        width: 60px;
      }

Here is an example:

https://stackblitz.com/edit/angular-fpweaf?file=app/app.component.ts

Another possible approach is to set a width (e.g. 3000px) directly to the Scheduler component, but then the scrollbar will be added to the page, not the Scheduler: 

    <kendo-scheduler
      [kendoSchedulerBinding]="events"
      [selectedDate]="selectedDate"
      startTime="07:00"
      endTime="19:00"
      style="height: 600px; width: 3000px"
    >

Here is an example of the second approach:

https://stackblitz.com/edit/angular-fpweaf-yppnb7?file=app/app.component.ts

I hope this helps. Let me know if I can assist any further.

Regards,
Martin
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Augusto
Top achievements
Rank 2
commented on 10 May 2024, 08:23 PM

Hi, I have the same problem on the Kendo Angular Scheduler. All the columns get squeezed because we have around 20-30 resources. Is there an easier way nowadays to set a min-width for the columns and to make the scheduler scroll them horizontally? Thanks
Martin Bechev
Telerik team
commented on 14 May 2024, 08:58 AM

Hi Augusto,

The Scheduler component exposes a columnWidth property, but it's applied only for the Timeline view. For the rest of the views, enabling the horizontal scroll by using custom CSS is the way to go. Here is the updated example:

https://stackblitz.com/edit/angular-ya8vs3?file=src%2Fapp%2Fevents-utc.ts,src%2Fapp%2Fapp.component.ts

Regards

Martin

Augusto
Top achievements
Rank 2
commented on 14 May 2024, 07:18 PM

Hi Martin,

Thanks for your reply and provided sample. I was hoping we could define a minimum column width, and only scroll horizontally the contents of the scheduler, leaving the scheduler header fixed so the button to switch between view modes remains visible on the top right. On that sample, the width of the entire scheduler component is set to a fixed value (3000px). Maybe what I'm after is not easily doable.

Thanks for your time.

Martin Bechev
Telerik team
commented on 15 May 2024, 12:03 PM

Hi Augusto,

Thank you for the provided additional details for this case.

Indeed scrolling only the content (without the header) is also possible by using custom CSS code.

.k-scheduler-content .k-scheduler-table, 
.k-scheduler-header-wrap .k-scheduler-table{
    width: 3000px;
  }

Here is an example:

https://stackblitz.com/edit/angular-ya8vs3-q1az7p?file=src%2Fapp%2Fevents-utc.ts,src%2Fapp%2Fapp.component.ts

 

Augusto
Top achievements
Rank 2
commented on 15 May 2024, 12:15 PM

That's very nice. Thanks a lot for your help.
Augusto
Top achievements
Rank 2
commented on 29 May 2024, 01:51 PM

Hi Martin,

I have upgraded to version 16.1.0 ("@progress/kendo-angular-scheduler": "^16.1.0") and the provided solution doesn't work anymore. I would really appreciate if you can provide a solution on this new version.

Regards.

Martin Bechev
Telerik team
commented on 29 May 2024, 03:23 PM

Hi Augusto,

With the latest version of the packages, some breaking changes were introduced, including changing CSS class syntax. Please try the following CSS to enable the scrolling:

.k-scheduler .k-scheduler-layout{
width: 3500px;
}
.k-scheduler multi-day-view{
overflow: scroll;
}
Augusto
Top achievements
Rank 2
commented on 29 May 2024, 04:27 PM

Thanks Martin. That was useful! Regards
Tags
Scheduler
Asked by
Ruben
Top achievements
Rank 2
Answers by
Martin Bechev
Telerik team
Share this question
or