【问题标题】:Material UI Data Grid first column fixed材质 UI 数据网格第一列已修复
【发布时间】:2021-11-08 20:51:25
【问题描述】:

在材质数据网格中水平滚动时是否可以固定第一列?我尝试选择第一个孩子并应用position: sticky,但它没有用。

【问题讨论】:

标签: reactjs datagrid material-ui


【解决方案1】:

要通过 initialState 设置固定列,请将具有以下形状的对象传递给此道具:

interface GridPinnedColumns {
  left?: string[]; // Optional field names to pin to the left
  right?: string[]; // Optional field names to pin to the right
}

此功能仅在 Data Grid Pro 中可用。更多你可以在这里看到https://mui.com/components/data-grid/columns/#column-pinning

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-14
    • 1970-01-01
    • 2022-06-26
    • 2020-12-21
    • 1970-01-01
    • 2017-03-24
    • 2022-10-13
    • 2021-04-12
    相关资源
    最近更新 更多