This is my code. While I was waiting for a response I tried using “collapse” and that does what I want. I guess that is ok, but is there a better way?
Now that I have a clear page, I need to display some of the fields selected, and then have the user enter some info… I’m looking into the best way to do that now…
import wixData from ‘wix-data’ ;
import wixWindow from ‘wix-window’ ; // for console output
// import wixLocation from ‘wix-location’;
$w( “#table1” ).columns = [
{ “id” : “col1” , “dataPath” : “lakeAddress” , “label” : “Lake Address” , “visible” : true , “type” : “stringfield2” },
{ “id” : “Col2” , “dataPath” : “parcelNumber” , “label” : “Parcel #” , “visible” : true , “type” : “string” },
{ “id” : “Col3” , “dataPath” : “name” , “label” : “Name” , “visible” : true , “type” : “string” },
{ “id” : “Col4” , “dataPath” : “mailAddress” , “label” : “Mail Address” , “visible” : true , “type” : “string” },
{ “id” : “Col5” , “dataPath” : “city” , “label” : “city” , “visible” : true , “type” : “string” },
{ “id” : “Col6” , “dataPath” : “state” , “label” : “state” , “visible” : true , “type” : “string” },
{ “id” : “Col7” , “dataPath” : “zip” , “label” : “zip” , “visible” : true , “type” : “string” }
];
export function Submit_click(event) {
wixData.query( “HLAGIS” )
.contains( “lakeAddress” ,$w( ‘#searchBox’ ).value)
.find()
.then(result => {
console.log( “Submitclick event” , result);
$w( “#table1” ).rows = result.items;
$w( “#table1” ).expand();
})
$w( “#table1” ).onRowSelect( (row_choosen) => {
let rowData = row_choosen.rowData;
console.log( "rowData is " ,rowData);
let rowIndex = row_choosen.rowIndex;
console.log( "RowIndex is " ,rowIndex);
$w( “#table1” ).collapse()
.then( () => {
console.log( “Done with table collapse” );
$w( “#searchBox” ).collapse()
.then( () => {
console.log( “Done with searchBox collapse” );
} );
$w( “#searchButton” ).collapse()
.then( () => {
console.log( “Done with searchButton collapse” );
} );
});