Thank you. I have checked the names to make sure there are no errors and that they match. But still no luck. So I decided to begin again with a very simple database and a very simple dropdown box. My simpledb only has 3 fields (Lastname, Firstname, Teamnumber). Below is my code. The dropdown box seems to work, and the table is displayed without any data being shown. There are 4 records in the database. Two records with Teamnumber of 1 and two records with Teamnumber of 2. So when I select 1 from the dropdown box, 2 records SHOULD show in the table. And when I select 2 from the dropdown box, 2 records SHOULD show as well. But in both cases, NOTHING shows in the table.
Any help would be greatly appreciated!!!
export function dropdown1_change(event, $w) {
wixData.query(‘Simpledb’)
// Query the collection for any items whose “Teamnumber” field contains
// the value the user selected in the dropdown
.contains(“Teamnumber”, $w(‘#dropdown1’).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
$w(“#table1”).rows = res.items;
$w(“#table1”).refresh();
});
}
$w.onReady(function () {
$w(“#table1”).columns = [{
“id”: “col1”,
“dataPath”: “Lastname”,
“label”: “Last Name”,
“width”: 100,
“visible”: true,
“type”: “string”,
}, {
“id”: “col2”,
“dataPath”: “Firstname”,
“label”: “First Name”,
“width”: 100,
“visible”: true,
“type”: “string”,
}, {
“id”: “col3”,
“dataPath”: “Teamnumber”,
“label”: “Team Number”,
“width”: 100,
“visible”: true,
“type”: “string”,
}, {
}];
});
$w(“#table1”).refresh();