Reactivesearch: FeatureRequest: Separate sorting into its own component

Created on 11 Feb 2018  路  4Comments  路  Source: appbaseio/reactivesearch

Issue Type:
enhancement

Description:
Currently, to the best of my knowledge, the sorting features are embedded in the result components. Perhaps it should be moved into a separate components for added flexibility/customizability?

Interestingly enough, on the ReactiveSearch homepage there is a picture showing a "sort by" dropdown beside the search form. Is this ability supported out of the box or is it a custom component?

image

enhancement

Most helpful comment

@metagrover - Got it. A demo would be great!

All 4 comments

Related #261

Update: If you wish to implement sorting as a separate component, we recommend you to create a react dropdown component for showing sort options and utilise the defaultQuery prop of the ReactiveList (or any result component).

The trick is to update the defaultQuery (containing sort query based on the active selection) prop of the result component whenever there is a change in the value of your sort dropdown component.

Hope this helps! I will also attach a demo app here in the comments sometime later for ease.

@metagrover - Got it. A demo would be great!

I will also attach a demo app here in the comments sometime later for ease.

@metagrover wanted to follow up on this -- I've been having the toughest time getting this to work locally -- is there any way you can post a working example here please? 馃檹

It would be a huge help!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrtinkz picture mrtinkz  路  3Comments

tiagogm picture tiagogm  路  3Comments

vharitonsky picture vharitonsky  路  4Comments

gabzon picture gabzon  路  4Comments

ymzoughi picture ymzoughi  路  4Comments