Skip to content

Commit

Permalink
docs(Scheduler):revamp resource grouping header template docs (#2404)
Browse files Browse the repository at this point in the history
* docs(Scheduler):revamp resource grouping header template docs

* Update components/scheduler/templates/resource-grouping-header.md

Co-authored-by: Nadezhda Tacheva <[email protected]>

---------

Co-authored-by: Nadezhda Tacheva <[email protected]>
  • Loading branch information
NansiYancheva and ntacheva authored Oct 1, 2024
1 parent acaac10 commit b92063c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion components/scheduler/templates/appointment.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ You can also style the entire appointments by adding a class to their wrapping e

## See Also

* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/appointment-templates)
* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/templates)

2 changes: 1 addition & 1 deletion components/scheduler/templates/dateheader.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ The `DateHeaderTemplate` can be defined for the [day and week Scheduler views]({

## See Also

* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/dateheader-templates)
* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/templates)

40 changes: 27 additions & 13 deletions components/scheduler/templates/resource-grouping-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can use the `SchedulerResourceGroupHeaderTemplate` to customize the renderin
The `SchedulerResourceGroupHeaderTemplate`:
* Is invoked for each resource when the Scheduler is configured to have resources and grouping.
* Applies in both horizontal and vertical grouping.
* Can be defined at the root level of the Scheduler and individually for each [Scheduler views]({%slug scheduler-views-overview%}). When configured at the root, the template applies to all views. If a `SchedulerResourceGroupHeaderTemplate` is defined at the view level, it will override the root-level template for that specific view.
* Can be defined individually for each [Scheduler view]({%slug scheduler-views-overview%}).

The `context` of the template is a `SchedulerResourceGroupHeaderTemplateContext` object that contains:

Expand All @@ -32,14 +32,6 @@ The `context` of the template is a `SchedulerResourceGroupHeaderTemplateContext`
@bind-Date="@StartDate"
Height="600px"
Width="900px">
<SchedulerResourceGroupHeaderTemplate>
Text: @context.Text
<br />
Value: @context.Value
<br />
Field: @context.Field
<br />
</SchedulerResourceGroupHeaderTemplate>
<SchedulerViews>
<SchedulerDayView StartTime="@DayStart">
<SchedulerResourceGroupHeaderTemplate>
Expand All @@ -62,9 +54,23 @@ The `context` of the template is a `SchedulerResourceGroupHeaderTemplateContext`
</p>
</SchedulerResourceGroupHeaderTemplate>
</SchedulerDayView>
<SchedulerWeekView StartTime="@DayStart" />
<SchedulerMultiDayView StartTime="@DayStart" />
<SchedulerMonthView></SchedulerMonthView>
<SchedulerWeekView StartTime="@DayStart">
<SchedulerResourceGroupHeaderTemplate>
<div>
<span class="meeting-title">@context.Text</span>
</div>
</SchedulerResourceGroupHeaderTemplate>
</SchedulerWeekView>
<SchedulerMonthView>
<SchedulerResourceGroupHeaderTemplate>
Text: @context.Text
<br />
Value: @context.Value
<br />
Field: @context.Field
<br />
</SchedulerResourceGroupHeaderTemplate>
</SchedulerMonthView>
</SchedulerViews>
<SchedulerResources>
<SchedulerResource Field="@nameof(AppointmentModel.RoomId)" TextField="Name" ValueField="Id" Data="@Rooms"></SchedulerResource>
Expand All @@ -76,6 +82,14 @@ The `context` of the template is a `SchedulerResourceGroupHeaderTemplateContext`
<TelerikTooltip TargetSelector=".tooltip-target" />
<style>
.meeting-title {
text-transform: uppercase;
font-style: italic;
color: red;
}
</style>
@code {
private List<string> GroupingResources = new List<string> { "RoomId" };
private DateTime today { get; set; }
Expand Down Expand Up @@ -172,5 +186,5 @@ The `context` of the template is a `SchedulerResourceGroupHeaderTemplateContext`

## See Also

* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/resourcegroupheader-templates)
* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/templates)

2 changes: 1 addition & 1 deletion components/scheduler/templates/slot.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,5 +310,5 @@ The `context` of the template is a `SchedulerSlotTemplateContext` object that co

## See Also

* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/slot-templates)
* [Live Demo: Scheduler Templates](https://demos.telerik.com/blazor-ui/scheduler/templates)

0 comments on commit b92063c

Please sign in to comment.