【发布时间】:2019-07-10 05:35:04
【问题描述】:
这是我的示例表
我的表格有分类器,所以我的标题是可点击的。我想要做的是如果表格是空的,我希望我的标题被禁用或不可点击。这可以用css吗?我还有其他方法可以做到这一点吗?下面是我用于列的代码。我的数据来自数据源。
const columns = [
{
title: 'LAST NAME',
dataIndex: 'lastName',
sorter: (a, b) => a.lastName.localeCompare(b.lastName),
width: '15%'
},
{
title: 'FIRST NAME',
dataIndex: 'givenName',
sorter: (a, b) => a.givenName.localeCompare(b.givenName),
width: '15%'
},
{
title: 'MIDDLE NAME',
dataIndex: 'middleName',
sorter: (a, b) => a.middleName.localeCompare(b.middleName),
width: '15%'
},
{
title: 'DATE OF BIRTH',
dataIndex: 'dateOfBirth',
sorter: (a, b) => a.dateOfBirth.localeCompare(b.dateOfBirth),
width: '14%'
},
{
title: 'GENDER',
dataIndex: 'sex',
sorter: (a, b) => a.sex.localeCompare(b.sex),
width: '12%'
},
{
title: 'ADDRESS',
dataIndex: 'address',
sorter: (a, b) => a.address.localeCompare(b.address),
},
];
【问题讨论】: