Skip to content

Commit b3c0ae8

Browse files
dimodidimodi
authored andcommitted
docs(DropDownButton|SplitButton): Docs feedback improvements
1 parent 3de55f7 commit b3c0ae8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#dropdownbutton-splitbutton-comparison
22
The DropDownButton and SplitButton components are similar. They both consist of a primary button and a dropdown element that holds additional action items. The major difference is the purpose of the primary button.
33

4-
* [DropDownButton]({%slug dropdownbutton-overview%}) - The main purpose of the primary button is to open the popup with additional actions. The primary button does expose a separate [`OnClick` event]({%slug dropdownbutton-events%}), so you can handle it to invoke a dedicated action but clicking on it always opens the dropdown.
4+
* [DropDownButton]({%slug dropdownbutton-overview%})—The main purpose of the primary button is to open the popup with additional actions. The primary button exposes a separate [`OnClick` event]({%slug dropdownbutton-events%}), which can invoke a dedicated action. Clicking on the DropDownButton always opens the dropdown.
55

6-
* [SplitButton]({%slug splitbutton-overview%}) - The main element contains a primary button and a separate button for opening the dropdown. The purpose of the primary button is to [invoke a standalone action]({%slug splitbutton-events%}#onclick). Clicking on it does not open the dropdown. To open the popup with the additional actions, the user has to click the dedicated button with `caret-alt-down` icon.
6+
* [SplitButton]({%slug splitbutton-overview%})—The main element contains a primary button and a separate button for opening the dropdown. The purpose of the primary button is to [invoke a standalone action]({%slug splitbutton-events%}#onclick). Clicking on it does not open the dropdown. To open the popup with the additional actions, the user has to click the dedicated button with `caret-alt-down` icon. It is possible to [switch the primary and dropdown actions programmatically]({%slug splitbutton-kb-change-primary-action-onclick%}).
77
#end

knowledge-base/splitbutton-dynamic-primary-change-onclick.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@ This KB article answers the following questions:
4444
````CSHTML
4545
@* Change SplitButton primary action on click *@
4646
47+
<p>Last click action: @SplitButtonLog</p>
48+
4749
<TelerikSplitButton Icon="@PrimaryButton.Icon"
4850
OnClick="@( () => OnSplitButtonClick(PrimaryButton) )">
4951
<SplitButtonContent>@PrimaryButton.Text</SplitButtonContent>
5052
<SplitButtonItems>
5153
@{
52-
var secondaryButtons = AllSplitButtons.Where(x => x.Id != PrimaryButton.Id);
53-
foreach (var button in secondaryButtons)
54+
foreach (var button in SecondaryButtons)
5455
{
55-
<SplitButtonItem Icon="@button.Icon"
56+
<SplitButtonItem @key="@button"
57+
Icon="@button.Icon"
5658
OnClick="@( () => OnSplitButtonClick(button) )">
5759
@button.Text
5860
</SplitButtonItem>
@@ -61,15 +63,15 @@ This KB article answers the following questions:
6163
</SplitButtonItems>
6264
</TelerikSplitButton>
6365
64-
Last click action: @SplitButtonLog
65-
6666
@code {
6767
private List<SplitButtonModel> AllSplitButtons { get; set; } = new List<SplitButtonModel>() {
6868
new SplitButtonModel() { Id = 1, Text = "Paste", Icon = SvgIcon.Clipboard },
6969
new SplitButtonModel() { Id = 2, Text = "Paste as Plain Text", Icon = SvgIcon.ClipboardText },
7070
new SplitButtonModel() { Id = 3, Text = "Paste as HTML", Icon = SvgIcon.ClipboardHtml },
7171
};
7272
73+
private List<SplitButtonModel> SecondaryButtons => AllSplitButtons.Where(x => x.Id != PrimaryButton.Id).ToList();
74+
7375
private SplitButtonModel PrimaryButton { get; set; } = null!;
7476
7577
private string SplitButtonLog { get; set; } = string.Empty;

0 commit comments

Comments
 (0)