hai guys i figure out the error but i am having one problem in that .i can’t filter the item in my code why
can u pls help me.
i attached my code in previous doubt
No sé si ya resolviste el error, pero en la parte de arriba ya habían comentado de ello…
Se debe porque estas consultando objetos y debes apuntar a cual quieres consultar… Ejemplo:
Ahí estoy apuntando a la descripción .
this.data.items = this.data.items.filter((v) => {
if (v.descripcion.toLowerCase().indexOf(val.toLowerCase()) > -1) {
return true;
}
return false;
})
Hey guys just like this
// return (item.toLowerCase().indexOf(val.toLowerCase()) > -1);
as like this work to me
// if (item.title.toLowerCase().indexOf(val.toLowerCase()) > -1) {
return true;
}else {
return false;
}
help me please somebody could tell me how return 2 or more values in searchbar ?
ex:
if (item.title.toLowerCase().indexOf(val.toLowerCase()) > -1 || item.description.toLowerCase().indexOf(val.toLowerCase()) > -1) {
any idea ?
I’m having a hard time understanding your description, so can you post:
- a sample complete list of items
- your entire
getItems()
function - sample search string
- what
getItems()
returns - what you want it to return instead