@@ -76,6 +76,8 @@ public BitDataGrid()
76
76
columnsFirstCollectedSubscriber . SubscribeOrMove ( _internalGridContext . ColumnsFirstCollected ) ;
77
77
}
78
78
79
+ private bool IsLoading => _pendingDataLoadCancellationTokenSource is not null ;
80
+
79
81
80
82
81
83
/// <summary>
@@ -90,15 +92,9 @@ public BitDataGrid()
90
92
[ Parameter ] public string ? Class { get ; set ; }
91
93
92
94
/// <summary>
93
- /// A queryable source of data for the grid.
94
- ///
95
- /// This could be in-memory data converted to queryable using the
96
- /// <see cref="System.Linq.Queryable.AsQueryable(System.Collections.IEnumerable)"/> extension method,
97
- /// or an EntityFramework DataSet or an <see cref="IQueryable"/> derived from it.
98
- ///
99
- /// You should supply either <see cref="Items"/> or <see cref="ItemsProvider"/>, but not both.
95
+ /// Alias of the ChildContent parameter.
100
96
/// </summary>
101
- [ Parameter ] public IQueryable < TGridItem > ? Items { get ; set ; }
97
+ [ Parameter ] public RenderFragment ? Columns { get ; set ; }
102
98
103
99
/// <summary>
104
100
/// Optionally defines a value for @key on each rendered row. Typically this should be used to specify a
@@ -113,11 +109,15 @@ public BitDataGrid()
113
109
[ Parameter ] public Func < TGridItem , object > ItemKey { get ; set ; } = x => x ! ;
114
110
115
111
/// <summary>
116
- /// A callback that supplies data for the rid.
112
+ /// A queryable source of data for the grid.
113
+ ///
114
+ /// This could be in-memory data converted to queryable using the
115
+ /// <see cref="System.Linq.Queryable.AsQueryable(System.Collections.IEnumerable)"/> extension method,
116
+ /// or an EntityFramework DataSet or an <see cref="IQueryable"/> derived from it.
117
117
///
118
118
/// You should supply either <see cref="Items"/> or <see cref="ItemsProvider"/>, but not both.
119
119
/// </summary>
120
- [ Parameter ] public BitDataGridItemsProvider < TGridItem > ? ItemsProvider { get ; set ; }
120
+ [ Parameter ] public IQueryable < TGridItem > ? Items { get ; set ; }
121
121
122
122
/// <summary>
123
123
/// This is applicable only when using <see cref="Virtualize"/>. It defines an expected height in pixels for
@@ -126,6 +126,18 @@ public BitDataGrid()
126
126
/// </summary>
127
127
[ Parameter ] public float ItemSize { get ; set ; } = 50 ;
128
128
129
+ /// <summary>
130
+ /// A callback that supplies data for the rid.
131
+ ///
132
+ /// You should supply either <see cref="Items"/> or <see cref="ItemsProvider"/>, but not both.
133
+ /// </summary>
134
+ [ Parameter ] public BitDataGridItemsProvider < TGridItem > ? ItemsProvider { get ; set ; }
135
+
136
+ /// <summary>
137
+ /// The custom template to render while loading the new items.
138
+ /// </summary>
139
+ [ Parameter ] public RenderFragment ? LoadingTemplate { get ; set ; }
140
+
129
141
/// <summary>
130
142
/// Optionally links this <see cref="BitDataGrid{TGridItem}"/> instance with a <see cref="BitDataGridPaginationState"/> model,
131
143
/// causing the grid to fetch and render only the current page of data.
@@ -419,7 +431,7 @@ private string AriaSortValue(BitDataGridColumnBase<TGridItem> column)
419
431
: ColumnClass ( column ) ;
420
432
421
433
private string GridClass ( )
422
- => $ "bitdatagrid { Class } { ( _pendingDataLoadCancellationTokenSource is null ? null : "loading" ) } ";
434
+ => $ "bitdatagrid { Class } { ( ( IsLoading && LoadingTemplate is null ) ? "loading" : null ) } ". Trim ( ) ;
423
435
424
436
private void CloseColumnOptions ( )
425
437
{
0 commit comments