Hide Table content upon load.

I thought it might be nice to hide table content on load. As seen in this video:
- YouTube mark 19:50

The video suggests to look at this page: https://www.wix.com/code/home/example/Hide-and-Show-Elements

However, I have no on on click event or mouse in set up for the data itself. The only option I have is to hide the table on load and I don’t want that. I also tried hiding the data set. Should I connect the onclick event to the menu item or is there something I am missing?

Hi!
On this video (i believe) you see side effect. Data to the table is loaded only by clicking “search”. Actually before there is just no data in table, and that’s why it’s empty

To achieve this you need to do the same: after in onClick event, get data from the collection and populate table with this data

If it’s not your case, please describe your usecase more - waht is your data, what is your site and page and what are you trying to achieve

Mikhail,
This is not the case the data loads before the onlick. I’ve changed nothing in regards to the code given in the template.

Hi Elizabeth,
Can you please clarify your question?

As Mikhail explained, what you saw in the video is the table being populated with data only when “search” is clicked. Is that what you’re trying to achieve? Or are you looking for a preloader ?

Ohad,
I am looking for table being populated with data only when “search”, which is what appears to be happening in the video, but it is not coded that way.

Here is what I have it matches the video exactly

The code looks fine.
I still don’t understand what is your question. Please try to clarify.

In the video if you see how the table loads it is blank. Mine is not. I would like it to load blank.

Is the table connected to a dataset? If so, it will get results on page load. What you need to do in this case is to disconnect it so it doesn’t get results on load.

I disconnected, now nothing is searchable. It is completely blank. So, I do not know where to go from here?

Hi,
Once again, your question isn’t clear.
Did search work before? If so, there’s no reason it should stop working if what you did is just disconnecting the table.
The code you pasted earlier takes care of searching and populating the table with the results. Please make sure that all the ids, database name and field name are correct.

There was nothing wrong with the code. Just that the example shows a clear table that populates results after search. The video comments suggested the hidden elements tutorial to get it to be that way, but I haven’t been able to use what I gleaned there to match the example. My table still loads with data.

Please advise how to hidden the table elements (or results) before we click the button ?

Because the Data to the table is loaded before we clicking “search”. Actually before there is loaded all data and show on the table when open the search page. I think it’s empty when open the search page and then when we clicking the search button then the results will be display. Any coding can initial the page (or clear the memory)

As susuggested, if you use code to populate the table, you should make sure that the table isn’t “connected” in the editor.
Alternatively, add $w(‘#table1’).rows = [] on pageReady.

Can I hidden the table before click the search button ? when clicking the button the table will display with the results.

Hi,
I try to use below coding to solve my problem. Thanks for your help.

$w.onReady(function () {
$w(‘#Table1’).hide();
});