I am going crazy, and been researching this for weeks, and followed every step in the tutorial " Velo Tutorial: Adding Collection Data Search Functionality " bc its exactly what i need. user enters a 6 digit number, hit submit, 1 record appears in the table with 6 columns of information or even on a separate results page would be fine… No dice. Tried running debug, it doesn’t change or tell me anything. below is the code with the table and I have 2 coa numbers (30000 and 30001) that I have filled in with info for testing and they are in the table if u page down on the table which I don’t know how to get rid of either… probably a clear button or if the user searches another number…
import wixData from ‘wix-data’ ;
export function searchButton_click ( event ) {
wixData . query ( “coa” )
// Query the collection for any items whose “coa” field contains
// the value the user entered in the input element
. contains ( “coa” , $w ( “#searchBox” ). value )
. find () // Run the query
. then ( res => {
// Set the table data to be the results of the query
$w ( “#resultsTable” ). rows = res.items ;
//$w(“#resultsTable”).expand(); //would like this table to appear when the results populate but cant get results atm
});
}
$w . onReady ( function () {
$w ( “#resultsTable” ). columns = [
{
“id” : “col1” , // ID of the column for code purposes
“dataPath” : “coa” , // The field key in the collection whose data this column displays
“label” : “COA” , // The column header
“width” : 100 , // Column width
“type” : “string” , // Data type for the column
},
{
“id” : “col2” ,
“dataPath” : “actorName” ,
“label” : “Actor Name” ,
“width” : 150 , // Column width
“type” : “string” ,
},
{
“id” : “col3” ,
“dataPath” : “date” ,
“label” : “date” ,
“width” : 100 , // Column width
“type” : “string” ,
},
{
“id” : “col4” ,
“dataPath” : “city” ,
“label” : “City” ,
“width” : 150 , // Column width
“type” : “string” ,
},
{
“id” : “col5” ,
“dataPath” : “event” ,
“label” : “Event” ,
“width” : 220 , // Column width
“type” : “string” ,
},
{
“id” : “col6” ,
“dataPath” : “itemDescription” ,
“label” : “Item Description” ,
“width” : 220 , // Column width
“type” : “string” ,
}]; //,
});
any help would be awesome i have been going in circles and find the same 4 things on making this and most have to do w drop downs which i dont need.