Sorting is not working with remote data
Hi,
I'm using Material Table (v 1.67.0) with remote data onOrderChange (orderedColumnId, orderDirection) function always returning orderDirection = 'asc', it should return alternatively both 'asc' and 'desc'. But with static data, sorting is working good, This seems to be a specific issue when fetching remote data.
handleTableSorting = (order, direction) => {
console.log('handleTableSorting', order, direction);
const query =ORDER BY '${this.state.columnName}' ${direction};
AP.request(${SEARCH_ISSUE}&jql=${query}&startAt=${start}&maxResults=${max})
.then((data) => {
this.setState({ tableData : data });
})
}
<MaterialTable
columns={this.state.columns}
data={this.state.tableData}
onOrderChange={this.handleTableSorting}
sorting={true}
/>
- OS: [windows 10]
- Browser [chrome]
- Version [1.67.0]
Please reply the solution ASAP.
Thank you
Unfortunately mbrn is inactive and not merging PR's. Use the official community fork @material-table/core instead. This bug should be fixed in the current version.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.
@material-table/core
Just installed this and the sorting works but not as expected, it randomly sorts without order.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.