Hello,
Is it possible to add a search bar to the indexed page/table
Hello,
Is it possible to add a search bar to the indexed page/table
What do you mean search bar for the indexed page / table?
You can add an input, for instance for a text input, and use the onChange event to filter your data. You can filter data by setting a dataset filter property or by using wix-data directly and setting a filter in the query. To give better advice we will need more information about your setup and what you want to do.
What you described is exactly what i would like to do, however, I am unsure of how to code that. Any assistance would be greatly appreciated.
Okay so I figured out how to do it thanks to this tutorial: - YouTube
However, I want to be able to search by Test Name and Test Code, how would i add a AND function for it to search through both in case someone wants to search for the test code instead of the name?
CODE:
import wixData from ‘wix-data’;
//For full API documentation, including code examples visit Velo API Reference - Wix.com
$w.onReady(function () {
//TODO: import wixData from ‘wix-data’;
});
export function searchButton_onClick(event) {
wixData.query(‘Test_Menu’)
.contains(‘title’, $w(‘#textInput1’).value)
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
}