I want to filter the column in alphabetical order here is the code to filter by the size how to do thank you
const columns = [{
title: 'First Name',
dataIndex: 'first_name',
sortDirections: ['descend', 'ascend'],
key: 'first_name',
width: '20%',
sorter: (a, b) => a.first_name.length - b.first_name.length,
}]
Simply define a new sorting routine in utils/sorter. js , add it to the Sorter “enum,” and use it in your sorter prop for any column that needs it. You can check out the CodeSandbox for this tutorial to play around with the result.
Rows can be selectable by making first column as a selectable column. You can use rowSelection.type to set selection type. Default is checkbox . selection happens when clicking checkbox by default.
You can use localeCompare()
sorter: (a, b) => a.first_name.localeCompare(b.first_name);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With