antd表:-对列进行排序的问题

问题描述

我有一个antd table,其优先级列。我要对该列进行排序。

问题是排序(升序和降序)仅发生一次。

此后,无论我单击排序器多少次,都不会对列进行排序。

enter image description here

const columns = [
  {
    title: 'Priority',dataIndex: 'Priority',key: 'Priority',sorter: (a,b) =>  (a.Priority || '').localeCompare(b.Priority || ''),render: (val)=><div title={val} className="text_overlap">{val}</div>
  }
];

<Table scroll={{ y: (this.form && this.form.getFieldValue('Team'))?'calc(100vh - 259px)':'calc(100vh - 213px)' }} 
             rowClassName={(record)=>record.Assigned===1?'SelectedRow':''}
            rowSelection={{type:'radio',selectedRowKeys:this.state.selectedRowKeys,onChange:(e)=>{  this.setState({selectedRowKeys:e}); this.props.onSave([]);   }}}
            pagination={false} 
            columns={columns} 
            dataSource={records} />

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)