I have a search page that works great. It searches the database and the results are displayed in a table. I want to be able to click on a row in the search results that takes one to a dynamic page that shows more detailed information. I believe the code should work but it doesn’t. Below is the code. One thing I noticed is that when you scroll over the results page, the cursor doesn’t even turn into a pointer. Any help would be greatly appreciated. Here is a link to the page: https://corrn123.wixsite.com/corrn2/search
The Code:
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixData from “wix-data”;
export function button1_click(event, $w) {
// Runs a query on the “CORRN_houses_list” collection
wixData.query(“corrnhouses”)
// Query the collection for any items whose “Occupant_sex” field contains
// the value the user entered in the input element
.eq(“occupant_sex”, $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”).expand();
$w(“#table1”).show();
});
}
$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”: “house_name”,
“label”: “House Name”, // The column header
“width”: 200, // Column width
“visible”: true ,
“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”: “demographics”,
“label”: “Demographics”, // The column header
“width”: 700, // Column width
“visible”: true ,
“type”: “string”, // Data type for the column
}
];
});
import wixLocation from ‘wix-location’;
export function table1_rowSelect(event) {
let rowData = event.rowData;
let rowIndex = event.rowIndex;
const myRow = event.target.rows[rowIndex];
wixLocation.to(${myRow["link-corrnhouses-imprint"]}
)
}