简体   繁体   English

使用 Blazorise DataGrid 在移动设备上隐藏一些列

[英]Hide some columns on mobile with Blazorise DataGrid

What is a proper syntax for hiding certain columns on small screens?在小屏幕上隐藏某些列的正确语法是什么?

I tried using:我尝试使用:

HeaderCellClass="d-none d-sm-block"
CellClass="@((_) => "d-none d-sm-block")"

which seemed to work BUT it resutled in some buggy UI这似乎有效,但它在一些错误的用户界面中重新出现在此处输入图像描述

as you can see, columns Ident and Main Author have some kind of "ghost border line"如您所见,Ident 和 Main Author 列有某种“幽灵边界线”

I was able to do this using a combination of the BlazorSize library and the Blazorise Displayable column attribute:我能够使用BlazorSize 库和 Blazorise Displayable列属性的组合来做到这一点:

<DataGridColumn TItem="Year" Field="@nameof(Year.YearDesc)" Displayable="@IsMediumUpMedia" Caption="Year"></DataGridColumn>

Where 'IsMediumUpMedia' is one of the variables available that is true on medium or higher view ports.其中“IsMediumUpMedia”是在中等或更高视口上可用的可用变量之一。

Try instead "d-sm-block" -> "d-sm-table-cell"改用"d-sm-block" -> "d-sm-table-cell"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM