From 3616a379ca4fd717896d73d4fea1089527667d82 Mon Sep 17 00:00:00 2001 From: Hristian Stefanov Date: Tue, 14 Mar 2023 11:04:41 +0200 Subject: [PATCH] docs(selects): add refresh method for selects --- _contentTemplates/dropdowns/methods.md | 1 + components/autocomplete/overview.md | 2 ++ components/combobox/overview.md | 4 ++++ components/dropdownlist/overview.md | 6 +++++- components/multicolumncombobox/overview.md | 15 ++++++++++----- components/multiselect/overview.md | 4 ++++ 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/_contentTemplates/dropdowns/methods.md b/_contentTemplates/dropdowns/methods.md index dcba30b79e..c283079a98 100644 --- a/_contentTemplates/dropdowns/methods.md +++ b/_contentTemplates/dropdowns/methods.md @@ -6,4 +6,5 @@ | `Close` | Closes the popup. | | `FocusAsync` | Focuses the main element of the component. Always `await` this call, as it relies on `JSInterop`. | | `Open` | Opens the popup. | +| `Refresh` | Re-renders the component popup. | #end diff --git a/components/autocomplete/overview.md b/components/autocomplete/overview.md index 49d83d6271..c1f3bc722c 100644 --- a/components/autocomplete/overview.md +++ b/components/autocomplete/overview.md @@ -151,6 +151,8 @@ Add a reference to the component instance to use the [AutoComplete's methods](/b private void OpenPopup() { AutoCompleteRef.Open(); + + AutoCompleteRef.Refresh(); } } ```` diff --git a/components/combobox/overview.md b/components/combobox/overview.md index d18b724583..efb845fd6a 100644 --- a/components/combobox/overview.md +++ b/components/combobox/overview.md @@ -151,6 +151,10 @@ Add a reference to the component instance to use the [ComboBox's methods](/blazo private void OpenPopup() { ComboBoxRef.Open(); + + ComboBoxValue = Suggestions.First(); + + ComboBoxRef.Refresh(); } } ```` diff --git a/components/dropdownlist/overview.md b/components/dropdownlist/overview.md index d6841817b2..f57f75fc99 100644 --- a/components/dropdownlist/overview.md +++ b/components/dropdownlist/overview.md @@ -136,7 +136,7 @@ Add a reference to the component instance to use the [DropDownList's methods](/b + Width="300px" /> Open Popup @@ -150,6 +150,10 @@ Add a reference to the component instance to use the [DropDownList's methods](/b private void OpenPopup() { DropDownListRef.Open(); + + DropDownListValue = DropDownListData.First(); + + DropDownListRef.Refresh(); } } ```` diff --git a/components/multicolumncombobox/overview.md b/components/multicolumncombobox/overview.md index df82bac89f..b38f204ef0 100644 --- a/components/multicolumncombobox/overview.md +++ b/components/multicolumncombobox/overview.md @@ -179,6 +179,7 @@ The table below lists the MultiComboBox methods. Also consult the [MultiColumnCo | `FocusAsync` | Focuses the component textbox. | | `Open` | Opens the component dropdown. | | `Rebind` | [Refreshes the component data]({%slug common-features-data-binding-overview%}#refresh-data). | +| `Refresh` | Re-renders the component popup. | >caption Using MultiColumnComboBox methods @@ -207,6 +208,10 @@ The table below lists the MultiComboBox methods. Also consult the [MultiColumnCo private void Open() { MultiColumnComboRef.Open(); + + SelectedProduct = 3; + + MultiColumnComboRef.Refresh(); } protected override void OnInitialized() @@ -214,11 +219,11 @@ The table below lists the MultiComboBox methods. Also consult the [MultiColumnCo var rnd = new Random(); Products = Enumerable.Range(1, 30).Select(x => new Product() - { - Id = x, - Name = $"Product {x}", - Quantity = rnd.Next(0, 30) - }).ToList(); + { + Id = x, + Name = $"Product {x}", + Quantity = rnd.Next(0, 30) + }).ToList(); base.OnInitialized(); } diff --git a/components/multiselect/overview.md b/components/multiselect/overview.md index cd6d827538..c15ef3e61d 100644 --- a/components/multiselect/overview.md +++ b/components/multiselect/overview.md @@ -167,6 +167,10 @@ Add a reference to the component instance to use the [MultiSelect's methods](/bl private void OpenPopup() { MultiSelectRef.Open(); + + MultiSelectValue = new List() { MultiSelectData.First() }; + + MultiSelectRef.Refresh(); } } ````