Simple filter doesnt work

Im just learning wix code, following the tutorial I created a simple database with a title field and some other fields as a test.

I created a text edit box so i can type in a search text, and a grid object so i can see the results.

I connect the grid to the data base and all the fields such as image, description etc.

Then i run the preview mode without typing anything, the grid shows all the table elements.

When i type into the search, even if i type something that is in the table, the grid is blank, seems the filter doesnt work??

Anybody knows why???

here is my code attached to the page

import wixData from "wix-data" 

$w.onReady(function () { 

}); 

export function iAddress_keyPress(event, $w) { 
    filter($w('#iAddress').value);  // iAddress is the name of the input text box 
} 

function filter(title) { 
    $w('#dataset1').setFilter(wixData.filter().contains('Title',title)); 
}

Hey,

Welcome to the Wix Code forums.

You need to make sure that you are using the Field Key and not the Field Name . The field key should be title - not Title .


You also need to make sure that the input field has been properly updated in the keyPress() function. For details, see the post Give the TextInput onKeyPress Function some time .

Good luck,

Yisrael