File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public partial class TableFilter : IFilter
4747 /// 获得/设置 ITable 实例
4848 /// </summary>
4949 [ Parameter ]
50+ [ NotNull ]
5051 public ITable ? Table { get ; set ; }
5152
5253 /// <summary>
@@ -76,11 +77,6 @@ public partial class TableFilter : IFilter
7677 [ NotNull ]
7778 public IFilterAction ? FilterAction { get ; set ; }
7879
79- /// <summary>
80- /// 获得 当前过滤条件是否激活
81- /// </summary>
82- internal bool HasFilter => ( Table != null ) && Table . Filters . ContainsKey ( Column . GetFieldName ( ) ) ;
83-
8480 private string _fieldKey = "" ;
8581
8682 /// <summary>
@@ -120,7 +116,7 @@ protected override async Task InvokeInitAsync()
120116 /// 过滤数据方法
121117 /// </summary>
122118 /// <returns></returns>
123- internal async Task OnFilterAsync ( )
119+ public async Task OnFilterAsync ( )
124120 {
125121 if ( Table != null )
126122 {
Original file line number Diff line number Diff line change @@ -7,5 +7,12 @@ namespace BootstrapBlazor.Components;
77
88internal static class TableFilterExtensions
99{
10- public static bool HasFilter ( this TableFilter ? filter ) => filter ? . HasFilter ?? false ;
10+ public static bool HasFilter ( this TableFilter ? filter )
11+ {
12+ if ( filter == null )
13+ {
14+ return false ;
15+ }
16+ return filter . Table . Filters . ContainsKey ( filter . Column . GetFieldName ( ) ) ;
17+ }
1118}
You can’t perform that action at this time.
0 commit comments