SAP / ui5-webcomponents-react

A wrapper implementation for React of the UI5 Web Components that are compliant with the SAP Fiori User Experience
https://sap.github.io/ui5-webcomponents-react/
Apache License 2.0
446 stars 101 forks source link

[AnalyticalTable] Expose `onFilter` event #6562

Open ThiagoSzz opened 3 weeks ago

ThiagoSzz commented 3 weeks ago

Is your feature request related to a problem?

According to this answer, it's necessary to use the useControlledState of reactTableOptions to get access to the filter state changes of an AnalyticalTable column.

Describe the solution you'd like

My suggestion is that an onFilter event is exposed through a property of the AnalyticalTable, just like we have for the onSort and onGroup events.

const handleOnFilter = (
  event?: CustomEvent<{...}>
) => { ... }

<AnalyticalTable
    data={data}
    filterable
    onFilter={(e) => handleOnFilter(e)}
/>

Describe alternatives you've considered

No response

Additional Context

A feature like this would be useful in cases where you need to get the filters applied to the columns and store them somewhere.

Organization

No response

Declaration