material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Sorting is not working with remote data

Open PATTANPARVIN opened this issue 5 years ago • 4 comments

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

PATTANPARVIN avatar Feb 08 '21 13:02 PATTANPARVIN

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.

peacechen avatar Feb 23 '21 15:02 peacechen

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.

stale[bot] avatar May 28 '21 07:05 stale[bot]

@material-table/core

Just installed this and the sorting works but not as expected, it randomly sorts without order.

AravindTReddy avatar Jun 04 '21 04:06 AravindTReddy

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.

stale[bot] avatar Sep 02 '21 10:09 stale[bot]