Use custom filter input component
I have a custom search box I'd like to use as the filter. When it is submitted (onSubmit) I'd like to call a function to filter Griddle where I can pass the query. Does this exist?
Still looking for a solution. :bomb:
I'll respond, as I know @ryanlanciaux is traveling today. I'm not 100% on exactly how, but you should be able to use refs to set the filter. I think you'd say show filter={false} then make your custom input reference griddle.refs.search or whatever its called. We know this isn't the ideal solution, but there should be some updates coming soon for this type of situation.
Thanks @blkmutt I can't find any documentation on griddle.refs.search. I would love more information on being able to have a custom search box when it arrives. :)
I was able to use a custom filter by performing the following steps. I am fairly new to ReactJS so I am not sure if this is the best way to do this.
I attached a "ref" to the Griddle component:
<Griddle ref='Griddle' results={results} columnMetadata={columnMeta} ... />
Then, in the onChangeHandler function (attached to my custom filter) I was able to:
this.refs.Griddle.setFilter("Your Text Here")
This would perform the filter on the Griddle Component.
This works great @Phillips126 - thank you!
In addition to using refs as described above (or function for obtaining refs) we have added additional customization features to Griddle. Any component used in griddle can now be passed in as an override and this functionality could be achieved through passing in custom components. Please see customization in the latest Griddle docs for more information. :+1: