work in progress, several bugs
This commit is contained in:
@@ -31,14 +31,14 @@ var ByCategory = React.createClass({
|
||||
var category = this.state.category;
|
||||
|
||||
FilterCriteriaActions.addAppliedCategoryFilter(fc.field_name, fcv.filter_value);
|
||||
NavigationActions.goToCategory(category, section, q)
|
||||
//NavigationActions.goToCategory(category, section, q)
|
||||
},
|
||||
removeAppliedFilter: function(name) {
|
||||
FilterCriteriaActions.removeAppliedCategoryFilter(name);
|
||||
var section = new Section(this.state.category.get('section'));
|
||||
var category = this.state.category;
|
||||
var q = {};
|
||||
NavigationActions.goToCategory(category, section, q);
|
||||
//var section = new Section(this.state.category.get('section'));
|
||||
//var category = this.state.category;
|
||||
//var q = {};
|
||||
//NavigationActions.goToCategory(category, section, q);
|
||||
|
||||
},
|
||||
render: function() {
|
||||
@@ -99,13 +99,16 @@ var ByCategory = React.createClass({
|
||||
return filters;
|
||||
},
|
||||
componentWillReceiveProps: function() {
|
||||
console.log("RECEIVING PROPS!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
var categoryId = this.getParams().id;
|
||||
ItemActions.loadByCategory(categoryId, FilterCriteriaStore.getAppliedCategoryFilters());
|
||||
CategoryActions.loadCategoryDetails(categoryId);
|
||||
},
|
||||
componentDidMount: function() {
|
||||
var categoryId = this.getParams().id;
|
||||
|
||||
//var query = this.getQuery();
|
||||
//FilterCriteriaActions.setAppliedCategoryFilters(query);
|
||||
|
||||
ItemActions.loadByCategory(categoryId, this.getQuery());
|
||||
|
||||
CategoryActions.loadCategoryDetails(categoryId);
|
||||
@@ -121,14 +124,17 @@ var ByCategory = React.createClass({
|
||||
},
|
||||
_onAppliedFiltersChange: function() {
|
||||
if(this.isMounted()) {
|
||||
console.log('FILTERS CHANGING: ', FilterCriteriaStore.getAppliedCategoryFilters());
|
||||
this.setState({
|
||||
appliedCategoryFilters: FilterCriteriaStore.getAppliedCategoryFilters()
|
||||
});
|
||||
var categoryId = this.getParams().id;
|
||||
//ItemActions.loadByCategory(categoryId, FilterCriteriaStore.getAppliedCategoryFilters());
|
||||
//CategoryActions.loadCategoryDetails(categoryId);
|
||||
|
||||
var section = new Section(this.state.category.get('section'));
|
||||
var category = this.state.category;
|
||||
|
||||
// TODO: investigate how to do this without setTimeout call
|
||||
setTimeout(function(){
|
||||
NavigationActions.goToCategory(category, section, this.state.appliedCategoryFilters);
|
||||
}.bind(this),0);
|
||||
}
|
||||
},
|
||||
_onChange: function() {
|
||||
|
||||
Reference in New Issue
Block a user