Sorting and filtering for hypergrid v2.1.8?
How to achieve sorting and filtering for hypergrid v2.1.8? I saw some old code which is using local addons. Could you provide an example using npm based packages or any available demo?
hello @sachindevtripathi yes I will post something this week
I realized documentation is not describing what and how about hypergrid features. Could you please add some description on:
- How to use features(e.g. ColumnSorting and Filtering, both are part of fin-hypergrid package), if they are reusable.
- What is the segregation for behavior, properties and dataModel. Some description would help.
- Creating a react hypergrid wrapper and using both sorting and filtering.
(1) Sorting and filtering are supported in the UI (i.e., in the feature chain) but are not otherwise supported by "the package." These features are entirely dependent on data model support and responsiveness to these calls.
The sorting and filtering data models for v2.x.x are archived in the old-addons repo where you will find functional examples.
For v3.0.0, there are newer (and much simpler) filtering examples, including:
- A global filter example which takes a javascript expression referencing columns by name
- A column filters example which demonstrates filter row UI. This too takes javascript expressions which may reference other columns by name. It also takes an abbreviated expression syntax for references to its own column.
These examples are almost certainly non-functional at the moment owing to active development of the Hypergrid v3.0.0 branch upon which they depend. (These repos are not ready for public use but we cannot unfortunately make repos private because we are not paying GitHub customers.) It is these two examples I was thinking of when I said I would "post something this week" above. What I meant was that I would bring them up to date with the current 3.0.0 alpha. I realize this may not be immediately useful to you inasmuch as v3.0.0 has not been released yet. However it will be released soon (definitely this month).
(There is also a combined filtering and sorting example for a "3.0.0" npm module that does not exist. Therefore it too is non-functional. This one may never be updated and might just be archived. The code may be instructive nonetheless.)
I must stress that all these filtering and sorting demos and data models are provided as sample code and are not part of the Hypergrid core package.
The data model interface for responding to sorting and filtering UI events is changing to an pub/sub model in v3.0.0 (not yet released). It will be fully documented upon release. The current interface is not documented, but can be inferred from DataSourceOrigin.js and DataSourceBase.js (https://github.com/fin-hypergrid/datasaur-base/tree/v0.4.10).
(2) The "behavior" deals with UI and interfacing to the data model. Properties are described in the properties Grid Propertieswiki.
(3) Sorry, I can't advise you regarding writing a React wrapper.
Thanks for your detailed answers I have few more questions and follow-ups:
- Any update on Hypergrid v3.0.0 release?
- Did you get chance to post something on sorting and filtering for Hypergrid v2.1.8?
- I am trying to show ticking data using Hypergrid. What should be the approach to do live update to the data? any example would help.