admin管理员组文章数量:1295886
We started a Blazor project using MudBlazor library. And we faced with issues with Server Data usage for filtering/sorting/pagination.
Idealy, we would like to extract table implementations to separate generic MudTable components (one general and one for filtering/pagination on Server side). Is there any implementations or instructions how to achieve this?
We want to achieve something similar as described here: MudBlazor Generic Server Side Table Pagination Issues
Currently, we use implementation without server data:
<MudTable Items="@vm.Users" Context="user" Filter="@FilterFunc" Dense Outlined Square Elevation="0" Class="px-4 py-2"
Loading="vm.Loading" LoadingProgressColor="Color.Primary">
<HeaderContent>
<MudTh><MudTableSortLabel SortBy="new Func<ManageUsersViewModel.User, object>(x=>x.Email)">E-mail Address</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<ManageUsersViewModel.User, object>(x=>x.Role)">Role</MudTableSortLabel></MudTh>
<MudTh><MudTableSortLabel SortBy="new Func<ManageUsersViewModel.User, object>(x=>x.Active)">Active</MudTableSortLabel></MudTh>
<MudTh>Actions</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd DataLabel="Email">@user.Email</MudTd>
<MudTd DataLabel="Role">@user.Role</MudTd>
<MudTd DataLabel="Active">@(user.Active ? "Yes" : "No")</MudTd>
<MudTd>
<MudIconButton Size="Size.Small" Icon="@Icons.Material.Filled.Edit" Color="Color.Primary" OnClick="(() => EditUser(user))"></MudIconButton>
</MudTd>
</RowTemplate>
<PagerContent>
<MudTablePager PageSizeOptions="@(new int[]{25, 100})" />
</PagerContent>
<LoadingContent>
<MudText>Loading...</MudText>
</LoadingContent>
<NoRecordsContent>
<MudText>No matching records found</MudText>
</NoRecordsContent>
</MudTable>
So, any examples how to use ServerData with filtering/sorting/pagination?
本文标签: blazorMudBlazor tables with Server DataStack Overflow
版权声明:本文标题:blazor - MudBlazor tables with Server Data - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741626021a2389086.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论