I followed the directions here: Velo Tutorial: Adding Collection Data Search Functionality | Help Center | Wix.com
to build this page here: https://braphox.wixsite.com/website/numberofpartslists-searchnumber-all
When I enter 6 the table should populate a 6 in column 2 and a 1 in column 3.
However, nothing happens.
Code for the page:
Note I did change lines 41 and 42 : from the guide lines 26 and 27.
]}); replaced the outline since it threw an unexpected symbol error.
Also, if anyone has thoughts on how to fill this table based on a calculated value stored in another table, how to retrieves said value; that would be fabulous.
import wixData from ‘wix-data’;
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
$w.onReady( function () {
$w(“#table1”).columns = [
{
“id”: “col1”, // ID of the column for code purposes
// The field key in the collection whose data this column displays
“dataPath”: “title”,
“label”: “Title”, // The column header
“width”: 100, // Column width
“visible”: true , // Column visibility
“type”: “string”, // Data type for the column
// Path for the column if it contains a link
//“linkPath”: “link-field-or-property”
},
{
“id”: “col2”, // ID of the column for code purposes
// The field key in the collection whose data this column displays
“dataPath”: “rpValue”,
“label”: “RPValue”, // The column header
“width”: 100, // Column width
“visible”: true , // Column visibility
“type”: “Number”, // Data type for the column
// Path for the column if it contains a link
//“linkPath”: “link-field-or-property”
},
{
“id”: “col3”,
“dataPath”: “permutations”,
“label”: “Permutations”,
“width”: 100,
“visible”: true ,
“type”: “Number”,
//“linkPath”: “link-field-or-property”
} //,
// more column objects here if necessary
// …
// …
]});
export function search_click(event, $w) {
wixData.query(‘NumberOfPartslists’)
// Query the collection for any items whose “Name” field contains
// the value the user entered in the input element
.contains(‘rpValue’, $w(‘#input1’).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
$w(‘#table1’).rows = res.items;
});
//Add your code for this event here:
}