File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
BootstrapBlazor.Server/Components/Samples/Table
BootstrapBlazor/Components/Table Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1616 <Table TItem =" Foo"
1717 Items =" @Items.Take(4)"
1818 RenderMode =" TableRenderMode.Table" AllowResizing =" true"
19- IsBordered =" true"
19+ IsBordered =" true" ScrollWidth = " 7 " ScrollHoverWidth = " 10 "
2020 IsStriped =" true" >
2121 <TableColumns >
2222 <TableColumn @bind-Field =" @context.Name" Width =" 120" Fixed =" true" />
101101 IsBordered =" true"
102102 IsStriped =" true"
103103 IsMultipleSelect =" true"
104- IsFixedHeader =" true"
104+ IsFixedHeader =" true" ScrollWidth = " 7 " ScrollHoverWidth = " 10 "
105105 FixedExtendButtonsColumn =" true"
106106 IsExtendButtonsInRowHeader =" true"
107107 FixedMultipleColumn =" true"
Original file line number Diff line number Diff line change 198198 }
199199
200200 <RenderTemplate OnRenderAsync =" OnTableRenderAsync" >
201- <div class =" @WrapperClassName" >
201+ <div class =" @WrapperClassName" style = " @ GetScrollStyleString (! IsFixedHeader ) " >
202202 @if (ActiveRenderMode == TableRenderMode .Table )
203203 {
204204 if (IsFixedHeader )
209209 @RenderHeader (true )
210210 < / table >
211211 < / div >
212- < div class = " table-fixed-body scroll" style = " @ScrollStyleString " >
212+ < div class = " table-fixed-body scroll" style = " @GetScrollStyleString(true) " >
213213 @RenderTable (false )
214214 < / div >
215215 }
Original file line number Diff line number Diff line change @@ -186,7 +186,9 @@ private string GetSortTooltip(ITableColumn col) => SortName != col.GetFieldName(
186186
187187 private string ScrollWidthString => $ "width: { ActualScrollWidth } px;";
188188
189- private string ScrollStyleString => $ "--bb-scroll-width: { ActualScrollWidth } px; --bb-scroll-hover-width: { ActualScrollHoverWidth } px;";
189+ private string ? GetScrollStyleString ( bool condition ) => condition
190+ ? $ "--bb-scroll-width: { ActualScrollWidth } px; --bb-scroll-hover-width: { ActualScrollHoverWidth } px;"
191+ : null ;
190192
191193 private int ActualScrollWidth => ScrollWidth ?? Options . CurrentValue . ScrollOptions . ScrollWidth ;
192194
You can’t perform that action at this time.
0 commit comments