|
|
|
@ -113,16 +113,17 @@ export class SearchEngine implements Filters
|
|
|
|
|
|
|
|
|
|
public dataIsOk(data: {[index: string]:string}) : boolean
|
|
|
|
|
{
|
|
|
|
|
const realSearch=this._inputValue.trim().toLowerCase();
|
|
|
|
|
// Pas de valeur sélectionnée = pas de filtre sur ce champ
|
|
|
|
|
if(this._inputValue.length === 0)
|
|
|
|
|
if(realSearch.length === 0)
|
|
|
|
|
return true;
|
|
|
|
|
// Sinon, on cherche la valeur saisie dans les champs définis :
|
|
|
|
|
// Sinon, on cherche la valeur saisie dans tous les champs définis :
|
|
|
|
|
for(let field in data)
|
|
|
|
|
{
|
|
|
|
|
if(this._fields2Search.indexOf(field) !== -1)
|
|
|
|
|
{
|
|
|
|
|
// Attention, recherche insensible à la casse, mais aux accents, etc.
|
|
|
|
|
if(data[field].toLowerCase().indexOf(this._inputValue.toLowerCase()) !== -1)
|
|
|
|
|
if(data[field].toLowerCase().indexOf(realSearch) !== -1)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|