Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4830

Modularized approach for handling multiple filters on a Page

$
0
0

@pavan_kumar_l wrote:

I have a fairly complicated list which I need to filter (state, tags, name, categories) and sort. Some of the filter properties allow multi selection (eg: categories, tags) and some are single selection (eg: state). I have many more pages coming in pipeline which fit in the same category.

Now I have already build various components for filtering and sorting but facing issues in storing states of the various filter and sort selections.

Since filters generally fits into a category of key - value pair which can be applied on collection I want to isolate this logic from controller and put somewhere in a mixin / service.

For example whenever there is a change in selection in filter / sort I'm planning to send an action to parent controller from the component and update the state of the same (expecting this to happen automatically - may be by using naming convention or some other means) and components would be observing on some controller property and updates itself based on the change.

Now my question is how to implement this kind of feature in controller in Ember way so that I don't have to write boilerplate in every controller.

Disclaimer : Ember newbie migrated from backbone - marionette

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4830

Trending Articles