From c12f2068f6b05597afe06ea3f43e4e5dcad6445e Mon Sep 17 00:00:00 2001 From: Nadezhda Tacheva Date: Mon, 14 Apr 2025 18:41:31 +0300 Subject: [PATCH 1/3] chore(MultiSelect): Add documentarion for SummaryTagtemplate --- components/multiselect/templates.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/components/multiselect/templates.md b/components/multiselect/templates.md index 221255c746..291f019f8a 100644 --- a/components/multiselect/templates.md +++ b/components/multiselect/templates.md @@ -16,6 +16,7 @@ The MultiSelect component allows you to change what is rendered in its items, he * [Item Template](#item-template) * [Tag Template](#tag-template) +* [Summary Tag Template](#summary-tag-template) * [Header Template](#header-template) * [Footer Template](#footer-template) * [No Data Template](#no-data-template) @@ -29,6 +30,14 @@ The MultiSelect component allows you to change what is rendered in its items, he @[template](/_contentTemplates/dropdowns/templates.md#tag-template) +## Summary Tag Template + +The `SummaryTagTemplate` controls the rendering of the summary tag. The Multiselect renders a summary tag in two cases: +* In [Single Tag Mode](slug:multiselect-tag-mode#single-mode). +* In Multiple Tag Mode - [when the selected items are more than the `MaxAllowedTags`](slug:multiselect-tag-mode#summarized-tags-based-on-the-number-of-selections). + +The context of the `SummaryTagTemplate` is of type `MultiSelectSummaryTagTemplateContext`. It provides an `Items` field (a `List`) that contains the selected items. + ## Header Template @[template](/_contentTemplates/dropdowns/templates.md#header-template) @@ -46,7 +55,7 @@ The MultiSelect component allows you to change what is rendered in its items, he >caption Using MultiSelect Templates ````RAZOR -@* MultiSelect component with HeaderTemplate, ItemTemplate, TagTemplate, FooterTemplate and NoDataTemplate *@ +@* MultiSelect component with HeaderTemplate, ItemTemplate, TagTemplate, SummaryTagTemplate, FooterTemplate and NoDataTemplate *@

@@ -57,6 +66,7 @@ The MultiSelect component allows you to change what is rendered in its items, he @bind-Value="@SelectedRoles" TextField="Title" ValueField="Id" + MaxAllowedTags="@MaxAllowedTags" Placeholder="Write the roles you need"> Select one or more: @@ -68,6 +78,9 @@ The MultiSelect component allows you to change what is rendered in its items, he @context.Title + + @(context.Items.Count() - MaxAllowedTags) more roles selected +

Total Positions: @MultiSelectData.Count()
@@ -80,11 +93,13 @@ The MultiSelect component allows you to change what is rendered in its items, he @code { - private List SelectedRoles { get; set; } + private List SelectedRoles { get; set; } = new List() { 1, 4, 5, 8 }; private bool IsDataAvailable { get; set; } = true; - private List MultiSelectData { get; set; } + private int MaxAllowedTags { get; set; } = 2; + + private List MultiSelectData { get; set; } private List SourceData { get; set; } = new List() { From fbe6983b6c9e5bcb8eb2d910043fb0023def6238 Mon Sep 17 00:00:00 2001 From: Nadezhda Tacheva <73842592+ntacheva@users.noreply.github.com> Date: Tue, 15 Apr 2025 17:19:33 +0300 Subject: [PATCH 2/3] Update components/multiselect/templates.md Co-authored-by: Iva Stefanova Koevska-Atanasova --- components/multiselect/templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/multiselect/templates.md b/components/multiselect/templates.md index 291f019f8a..d5786a937a 100644 --- a/components/multiselect/templates.md +++ b/components/multiselect/templates.md @@ -32,7 +32,7 @@ The MultiSelect component allows you to change what is rendered in its items, he ## Summary Tag Template -The `SummaryTagTemplate` controls the rendering of the summary tag. The Multiselect renders a summary tag in two cases: +The `SummaryTagTemplate` controls the rendering of the summary tag. The Multiselect renders a summary tag in the following cases: * In [Single Tag Mode](slug:multiselect-tag-mode#single-mode). * In Multiple Tag Mode - [when the selected items are more than the `MaxAllowedTags`](slug:multiselect-tag-mode#summarized-tags-based-on-the-number-of-selections). From 1152e8eed845287bcc98b6a5081784484a943263 Mon Sep 17 00:00:00 2001 From: Nadezhda Tacheva <73842592+ntacheva@users.noreply.github.com> Date: Tue, 15 Apr 2025 17:19:42 +0300 Subject: [PATCH 3/3] Update components/multiselect/templates.md Co-authored-by: Iva Stefanova Koevska-Atanasova --- components/multiselect/templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/multiselect/templates.md b/components/multiselect/templates.md index d5786a937a..9fb192fa63 100644 --- a/components/multiselect/templates.md +++ b/components/multiselect/templates.md @@ -34,7 +34,7 @@ The MultiSelect component allows you to change what is rendered in its items, he The `SummaryTagTemplate` controls the rendering of the summary tag. The Multiselect renders a summary tag in the following cases: * In [Single Tag Mode](slug:multiselect-tag-mode#single-mode). -* In Multiple Tag Mode - [when the selected items are more than the `MaxAllowedTags`](slug:multiselect-tag-mode#summarized-tags-based-on-the-number-of-selections). +* In Multiple Tag Mode—[when the selected items are more than the `MaxAllowedTags`](slug:multiselect-tag-mode#summarized-tags-based-on-the-number-of-selections). The context of the `SummaryTagTemplate` is of type `MultiSelectSummaryTagTemplateContext`. It provides an `Items` field (a `List`) that contains the selected items.