ngduc / react-tabulator

React Tabulator is based on tabulator - a JS table library with many advanced features.
https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js
MIT License
366 stars 84 forks source link

bug: Table not rerender after options update #214

Closed IvanSavoskin closed 3 years ago

IvanSavoskin commented 3 years ago

Environment Details

Long Description I need to update an empty table placeholder on localization or on error while getting data. You can't do this through ref, localization also does not provide for placeholder localization. The same applies to many other parameters, when updating which the table is simply not rendered (For example, when changing pagination from local to undefined)

ngduc commented 3 years ago

I will check about option changes. In the mean time, please set "key" to something else to force it rerender the ReactTabulator component like:

const [tableKey, setTableKey] = React.useState(`${Math.random()}`)

on change, setTableKey(`${Math.random()}`)

<ReactTabulator key={tableKey} ref={tableRef} columns={columns} data={data}
ngduc commented 3 years ago

Related ticket https://github.com/ngduc/react-tabulator/issues/199

ngduc commented 3 years ago

Released 0.14.7: when "options" prop changed, it will rebuild the table to reflect that change. Let me know if you still have this issue. Thanks.

IvanSavoskin commented 3 years ago

@ngduc Very cool. Everything works, thanks a lot

ngduc commented 3 years ago

This build has one issue which is fixed in 0.15.0. Please upgrade.

IvanSavoskin commented 3 years ago

@ngduc Thank you very much

christianitis commented 2 years ago

Still not working for me...