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
10 changes: 10 additions & 0 deletions src/BootstrapBlazor/Components/Table/Table.razor.Search.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ protected List<IFilterAction> GetAdvanceSearches()
/// </summary>
protected List<IFilterAction> GetSearches() => Columns.Where(col => col.GetSearchable()).ToSearches(SearchText);

private async Task OnSearchTextValueChanged(string? value)
{
SearchText = value;

if (AutoSearchOnValueChanged)
{
await SearchClick();
}
}
Comment thread
ArgoZhang marked this conversation as resolved.
Outdated
Comment thread
ArgoZhang marked this conversation as resolved.
Outdated

/// <summary>
/// <para lang="zh">点击重置搜索按钮时调用此方法</para>
/// <para lang="en">Method called when the reset search button is clicked</para>
Expand Down
7 changes: 7 additions & 0 deletions src/BootstrapBlazor/Components/Table/Table.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
[Parameter]
public bool AutoSearchOnInput { get; set; }

/// <summary>
/// <para lang="zh">获得/设置 模糊搜索栏文本更新后是否自动搜索 默认值 false</para>
/// <para lang="en">Gets or sets whether to auto search when fuzzy search bar value changed. Default false</para>
/// </summary>
[Parameter]
public bool AutoSearchOnValueChanged { get; set; }
Comment thread
ArgoZhang marked this conversation as resolved.
Outdated

/// <summary>
/// <para lang="zh">获得/设置 不支持过滤类型提示信息 默认 null 读取资源文件内容</para>
/// <para lang="en">Gets or sets Not Supported Column Filter Message. Default null (Read from resource file)</para>
Expand Down