bug fix filtering
This commit is contained in:
@@ -40,8 +40,6 @@ var ByCategory = React.createClass({
|
|||||||
var q = {};
|
var q = {};
|
||||||
NavigationActions.goToCategory(category, section, q);
|
NavigationActions.goToCategory(category, section, q);
|
||||||
|
|
||||||
var categoryId = this.getParams().id;
|
|
||||||
ItemActions.loadByCategory(categoryId, this.getQuery());
|
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
@@ -101,8 +99,9 @@ var ByCategory = React.createClass({
|
|||||||
return filters;
|
return filters;
|
||||||
},
|
},
|
||||||
componentWillReceiveProps: function() {
|
componentWillReceiveProps: function() {
|
||||||
|
console.log("RECEIVING PROPS!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
var categoryId = this.getParams().id;
|
var categoryId = this.getParams().id;
|
||||||
ItemActions.loadByCategory(categoryId, this.getQuery());
|
ItemActions.loadByCategory(categoryId, FilterCriteriaStore.getAppliedCategoryFilters());
|
||||||
CategoryActions.loadCategoryDetails(categoryId);
|
CategoryActions.loadCategoryDetails(categoryId);
|
||||||
},
|
},
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
@@ -126,6 +125,10 @@ var ByCategory = React.createClass({
|
|||||||
this.setState({
|
this.setState({
|
||||||
appliedCategoryFilters: FilterCriteriaStore.getAppliedCategoryFilters()
|
appliedCategoryFilters: FilterCriteriaStore.getAppliedCategoryFilters()
|
||||||
});
|
});
|
||||||
|
var categoryId = this.getParams().id;
|
||||||
|
//ItemActions.loadByCategory(categoryId, FilterCriteriaStore.getAppliedCategoryFilters());
|
||||||
|
//CategoryActions.loadCategoryDetails(categoryId);
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_onChange: function() {
|
_onChange: function() {
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ var ItemCollection = Backbone.Collection.extend({
|
|||||||
this.filters = this.filters || {};
|
this.filters = this.filters || {};
|
||||||
this.filters[name] = value;
|
this.filters[name] = value;
|
||||||
},
|
},
|
||||||
|
clearFilter: function() {
|
||||||
|
this.filters = [];
|
||||||
|
},
|
||||||
setLimit: function(limit) {
|
setLimit: function(limit) {
|
||||||
this.queryLimit = limit;
|
this.queryLimit = limit;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ var fetchItemWithDetails = function() {
|
|||||||
|
|
||||||
var fetchItemsByCategory = function(categoryId, query) {
|
var fetchItemsByCategory = function(categoryId, query) {
|
||||||
var items = _itemsByCategory;
|
var items = _itemsByCategory;
|
||||||
|
items.clearFilter();
|
||||||
items.setClassificationType(2);
|
items.setClassificationType(2);
|
||||||
items.setClassificationId(categoryId);
|
items.setClassificationId(categoryId);
|
||||||
items.setLimit(30);
|
items.setLimit(30);
|
||||||
|
|||||||
Reference in New Issue
Block a user