I am not using wix dataset, I am using SQL. I am having 2 issues:
- When the page loads, the table has 3 blank rows. No query is being executed. Only a function to populate the table header row:
$w ( “#tableResults” ). columns = [
{
“id” : “coldt” ,
“dataPath” : “date” ,
“label” : “Date” ,
“visible” : true ,
“type” : “date” ,
“width” : 80 ,
},
etc…
]
How can I get the blank table rows removed?
- How can I clear the results of my table (keeping the header record) without executing a dummy query?
I execute my search function when the user clicks the Search button like this:
async function doSearch ()
{
let myResults = await getData ()
$w ( "#tableResults" ). rows = myResults ;
console . log ( myResults )
}
And here is my Clear function that does not remove the table rows:
export function btnClear_click ( event ) {
$w ( “#tableResults” ). rows . length = 0 // This does not work
clearFormElements ( $w )
}
Thanks in advance.