1

I go problem with sorting data in table because when I using sorter with render function sort work only time

{
  title: 'App',
  dataIndex: 'location',
  render: location => location.join(', '),
  sorter: true
}, {
  title: 'Priority',
  dataIndex: 'priority',
  sorter: true
}

Sorter buttons in column dosen't change and i got the same data from table handle event function. I dont want write sorter function on frontend because i do this on backend

Nick
  • 138,499
  • 22
  • 57
  • 95
  • Did you [consider ajax table](https://ant.design/components/table/#components-table-demo-ajax)? – Alejandro Nov 27 '18 at 10:08
  • Hi @Alex thanks for response. I try this emaple but its dosen't help for me. Sorter works well when I remove render function with custom display from column where I try to use it. My data flow is -> sorter click on table -> redux action -> api call -> new data going in to redux -> display data in table. I dont know what is going on because sorter working only in one way, only when i click first time, sorter table event return good value. Next time when I cliking sorter data dosent change. Do you have an idea what could be the reason? – Damian Zborowski Nov 28 '18 at 20:56
  • Please update the question with non-working snippet – Hassan Imam Dec 10 '18 at 08:20

2 Answers2

0

you can update antd-3.11.0 version

siven
  • 54
  • 2
0

If you want to send api calls upon sorting, you will be using onChange function for this. Details can be found in the api of antd table.

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 09 '21 at 08:48
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30294075) – Koen Hollander Nov 09 '21 at 14:55