Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/Components/Select/SelectTree.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace BootstrapBlazor.Components
@namespace BootstrapBlazor.Components
@typeparam TValue
@inherits PopoverSelectBase<TValue>
@attribute [BootstrapModuleAutoLoader("Select/SelectTree.razor.js")]
Expand All @@ -22,7 +22,7 @@
<div class="dropdown-menu">
<TreeView TItem="TValue" Items="@Items" ShowIcon="ShowIcon" @ref="_tv"
OnTreeItemClick="OnItemClick" ModelEqualityComparer="@ModelEqualityComparer"
ShowSearch="ShowSearch" ShowResetSearchButton="ShowResetSearchButton"
ShowSearch="ShowSearch" ShowResetSearchButton="ShowResetSearchButton" OnSearchAsync="OnSearchAsync"
CanExpandWhenDisabled="CanExpandWhenDisabled"
CustomKeyAttribute="@CustomKeyAttribute" OnExpandNodeAsync="@OnExpandNodeAsync" />
</div>
Expand Down
9 changes: 9 additions & 0 deletions src/BootstrapBlazor/Components/Select/SelectTree.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

using Microsoft.Extensions.Localization;
using System.Timers;

namespace BootstrapBlazor.Components;

Expand Down Expand Up @@ -134,6 +135,14 @@ public partial class SelectTree<TValue> : IModelEqualityComparer<TValue>
[Parameter]
public bool ShowSearch { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 搜索回调方法,默认为 null</para>
/// <para lang="en">Gets or sets the search callback method. Default is null</para>
/// </summary>
/// <remarks>Enabled by setting <see cref="ShowSearch"/> to true.</remarks>
[Parameter]
public Func<string?, Task<List<TreeViewItem<TValue>>?>>? OnSearchAsync { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 是否固定搜索栏 默认 false 不固定</para>
/// <para lang="en">Gets or sets Whether fixed search box. Default false</para>
Expand Down
Loading