fin-hypergrid / fin-hypergrid/core
How to use plugins (e.g. datasaur-indexed) with client-side JS only?
- Dominant language
- JavaScript
- Stars
- 907
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to do filtering on my Hypergrid, but I cannot seem to attach the dataModel properly, the grid.behavior.dataModel does not have a setFilter function, could someone help with setting this up, or point to a vanilla JS tutorial for filtering? I've looked through the documentation at
[https://github.com/fin-hypergrid/datasaur-indexed](url) and
[https://github.com/fin-hypergrid/fin-hypergrid-filtering-demo](url)
but am unable to figure it out. What I have added to my page is the datasaur-indexed.js file, the 2 local/filter variables, and the dataModel: new DataModelFilter(new DataModelLocal)
Any clues? I'm not receiving any errors, but am also not seeing the setFilter function.
```html
```
javascript snippet:
```js
var div = document.querySelector('div#' + this.config.div_id);
var DataModelLocal = fin.Hypergrid.require('datasaur-local'); // v3.0.0 or higher
var DataModelFilter = fin.Hypergrid.require('datasaur-indexed'); // this version must be >= that of datasaur-local
grid = new fin.Hypergrid(div, {
dataModel: new DataModelFilter(new DataModelLocal),
data: data.data,
schema: this.config.customSchema
});
```
Contributor guide
Assessment
This issue has not been assessed yet.