Hello.
I have 10 filters for a single json object:
var filtro1 = function(value, selecionado){
var data = JSON.parse(JSON.stringify(json.aPesquisa));
var result = data.filter(function(pesquisa){
...
});
return result;
}
var filtro2 = function(value, selecionado){
var data = JSON.parse(JSON.stringify(json.aPesquisa));
var result = data.filter(function(pesquisa){
...
});
return result;
}
var filtro3 = function(horamin, horamax){
var data = JSON.parse(JSON.stringify(json.aPesquisa));
var result = data.filter(function(pesquisa){
...
});
return result;
}
var filtro4 = function(value, selecionado){
var data = JSON.parse(JSON.stringify(json.aPesquisa));
var result = data.filter(function(pesquisa){
...
});
return result;
}
...
And so on. As you can see each filter works separately ie if I filter with filter1 and then filter2 it only displays filter2.
Would there be any way I could put these filters together?
I thought about using an array with the filters selected:
var filtros = ["filtro1, "filtro2", "filtro6", "filtro9", "filtro10"];
But I could not.
The idea and interlink the filters.