ProTable pagination prevent leaving when you click other page numbers 2

69 阅读1分钟

Questions

But things won't be so easy.

If there are filters and sorters on table headers, when you click filters, you will find that these operations can execute the pagination change event function, and you can not prevent the state of filters and sorters.

According to the pre-blogs, there are several problems:

  1. click sorters, no requests can be fetched, cause it changed and the proTable component's props "request" is false
  2. click filters, the pagination changed at the same time. but if you cancel the confirm modal, the changed filters state will not recover to before, which the filters functions are not supported to prevent.

So sorters and filters can not be prevented if without any other particular ways. I need to tick these two types like no prevent.

Souce Code

image.png Use action type to find the way to filter whether to prevent or reload.