xh / hoist-react

🏗️ ⚛️ The XH Hoist toolkit for React
https://xh.io
Apache License 2.0
24 stars 9 forks source link

`StoreFilterField` default behavior does not mesh well with `ZoneGrid` #3660

Open amcclain opened 6 months ago

amcclain commented 6 months ago

When bound to a GridModel, SFF defaults to only including visible columns in its search:

https://github.com/xh/hoist-react/blob/8f97a34e8c9d3ecf2557843e6e3b43243c780c86/cmp/store/impl/StoreFilterFieldImplModel.ts#L164

This is a good default for normal grids, but does not play well with ZoneGrid, where the visible leaf columns do not directly relate to visible fields. You can see the poor result in our Toolbox mobile ZoneGrid example, which has a SFF configured. (Same problem would manifest on desktop, we just don't have a handy example there.)

I believe we want to be able to bind SFF to a ZonedGridModel and have it adjust its handling accordingly. (This would also avoid the awkwardness you see in the TB example of having to manually bind SFF to model.zoneGridModel.gridModel - which itself is a bit of a hint that something isn't quite ideal)

amcclain commented 4 months ago

@haynesjm42 noted that we might benefit from more specific higher order GridFilterField / ZoneGridFilterField components with clearer props APIs and dedicated handling.