changed itemcollection to support filtering by traits

This commit is contained in:
Edin Dazdarevic
2015-02-11 07:11:28 +01:00
parent 108f370bd0
commit 3986ac340c
4 changed files with 38 additions and 13 deletions

View File

@@ -25,7 +25,6 @@ var ByCategory = React.createClass({
var q = {};
q[fc.field_name] = fcv.filter_value;
// TODO: fix this, clean this up
var section = new Section(this.state.category.get('section'));
var category = this.state.category;
NavigationActions.goToCategory(category, section, q)
@@ -70,12 +69,13 @@ var ByCategory = React.createClass({
},
componentWillReceiveProps: function() {
var categoryId = this.getParams().id;
ItemActions.loadByCategory(categoryId);
ItemActions.loadByCategory(categoryId, this.getQuery());
CategoryActions.loadCategoryDetails(categoryId);
},
componentDidMount: function() {
var categoryId = this.getParams().id;
ItemActions.loadByCategory(categoryId);
ItemActions.loadByCategory(categoryId, this.getQuery());
CategoryActions.loadCategoryDetails(categoryId);
ItemStore.addChangeListener(this._onChange);