【发布时间】:2021-06-02 11:17:29
【问题描述】:
我正在使用 Ag-grid 侧边栏并希望将所有列显示为选中或取消选中的选项,但有些是只读的。我没有任何数据组。
我一直在查看文档,它说我需要将 functionsReadOnly 设置为 tru 但这不起作用
似乎我必须设置pivotMode:true,但这样做会使网格上的所有列都消失
我希望我的所有列都显示,但只是将侧边栏中的一些选项禁用。
这是我的代码
config.js
{ columnDefs: [
{
headerName: 'ColA',
field: 'colA',
},
{
headerName: 'ColB',
field: 'colB'
enablePivot: true
},
{
headerName: 'uploadedFiles.fileFormat',
field: 'formatDescription'
},
{
headerName: 'ColC',
field: 'colC',
}
],
defaultColDef: {
sortable: true,
suppressMenu: false,
resizable: true,
suppressColumnsToolPanel: false
},
rowSelection: 'single',
sideBar: {
toolPanels: [
{
id: 'columns',
labelDefault: 'Columns',
toolPanel: 'agColumnsToolPanel',
toolPanelParams: {
suppressRowGroups: true,
suppressValues: true,
suppressPivots: true,
suppressPivotMode: true,
suppressSideButtons: true
}
}
],
hiddenByDefault: true
},
pivotMode:true
}
我希望所有这些列都显示在网格上,并且所有选项都显示在侧边栏中...我只想禁用 colB 但启用枢轴模式会使所有列在网格上消失并且只使用 functionsReadOnly在 colB 上什么都不做
【问题讨论】:
标签: reactjs ag-grid ag-grid-react