Deleting table's sample items is not removing all the data

Hello again and thank you in advance.

I have a table displaying the results of a collection search ( http://www.mindfulmoment.be/practitioners-search) .

I set up this page by adding a table to the page, then adding the code to define the columns of the table… to be populated by the search results when the visitor performs a search.

**The PROBLEM: **
When you initially go to this page, BEFORE performing a search , some of the data from the original sample table items is displaying – see the mystery 3 gmail addresses in an otherwise empty table.

When I originally added the table to the page, I went to MANAGE ITEMS and deleted the sample items that are there when you first add a table. BUT somehow some of the data from those sample items is still displaying.

The search works fine and the results replace this mystery data, but the mystery emails should not be there. I deleted all the sample items from the table.

QUESTION:
How can I get rid of these mystery emails so that my visitors are not confused?

Any ideas? Thank you again, Cynthia-

There isn’t any reason that this page should be a dynamic page and is probably the reason for getting “mystery” entries. In fact, this page isn’t even connected to a dynamic-dataset and therefore isn’t event properly configured as a dynamic page.

You should redefine this page as a regular page and the table should appear empty when first opening the page. The search function that you have should then properly populate the table.

Ooooops!, you are correct, Yisrael. I made it dynamic because I initially had the dropdown items populating from the DB collection, rather than hardcoded, but it did not work the way I wanted, so I hardcoded the dropdown.

I will make that change. Thank you soooooo much!!! : -)

1 Like

Hello again Yisrael… still having an issue.

I created a new, standard (not-dynamic) version of the page and the new table on the new page is STILL displaying sample data from when I initially added the table to the page. If you go to manage items , it will not allow you to delete all the items. It insists that at least ONE field (column) be defined.

And beyond that, and this is bizarre: I left the default column for PROFILE PIC as the only remaining column… but when you browse to the page, it shows the sample data from the EMAIL column, which I have deleted! This is a completely new page with a newly-defined table. No copy / paste.

Lastly, my search code stopped working on the standard page. It still works on the dynamic version.

Here’s the NEW, standard page
http://www.mindfulmoment.be/search-practitioner-provincie

Here’s the original dynamic version of the page - with a functioning search feature (search for Brussel, please).
http://www.mindfulmoment.be/practitioners-search

**How can I get rid of the old-sample-data that is being displayed before the visitor searches. ** It is so unprofessional. I would LOVE to make it work on the DYNAMIC version, since my search works on that page.

I appreciate immensely any assistance. Thank you kindly! Cynthia-

Hi Cynthia,

First of all, you have two onReady() functions in you code. You should only have one.

Although you deleted the email column from the Table definitions, you’ve defined it in the onReady() function. All of the columns that appear are as a result of the $w(“#table1”).columns = [{ in the onReady() function.

To start with an empty table, add the following statement to the beginning of the onReady() function:
** $w(“#table1”).rows = ;**

The reason the search isn’t working is because it isn’t correctly connected to the button’s onClick() event handler:

BTW - For a more professional appearance, you might want to consider using a Repeater in place of a Table.

I hope this helps,

Yisrael

Thank you so much, Yisrael. I understadn your comments and will be putting them to work this evening. I’ll let you know how it goes… and thank you again. : -)

1 Like

Thank you again, Yisrael… your suggestions worked. Whew!

You mentioned using a repeater. Yes, this is what I want to do, but I cannot find a code example for connecting a repeater to search results data – to build the repeater on the fly, like the table on my page. I can only connect it directly to a collection using a dynamic page.

Do you know of any examples where a repeater is used with search results data?

Any links or examples you can provide are greatly appreciated. : -)

With kindest regards… Cynthia-

Cynthia, Here’s one example: Search a Database which shows results in a Repeater. Other similar examples are available on the Examples Index page .

@yisrael-wix WOW, from what I can tell without getting into the editor, that example is EXACTLY what I have been searching for. I even posted a request for it to the forum. Thank you Sooooo much, Yisrael, for the thorough example. I will be looking into the editor version tonight. I cannot thank you enough. I’ll let you know how it goes.

: -)

1 Like

@yisrael-wix Hello again, Yisrael. I am writing simply to formally thank you so very much for the useful help you have given me, to express my appreciation and to tell you that I finally completed the project … and in case it interests you, here are the final pages (it’s pretty basic stuff and my code could be streamlined with a case statement and the use of a few variables, but…):

View and filter a collection using a repeater:
http://www.mindfulmoment.be/moment-practitioners

Add records to the collection
http://www.mindfulmoment.be/practitioners-form

Still searching for a way to allow users to UPDATE/EDIT the collection, but for now, this is enough.

Thank you again and take care! Cynthia-

1 Like

Hey Cynthia, All of us in the support team enjoy providing help and answers - and it gives us the #warmfuzzies when we see a user succeeding as a result of our assistance. Thank you so much for your post. :smiling_face:

BTW - Nice job on the site. (Although, I was unable to get to the practitioners-form ).

@web A record in a collection can be updated using wix-data.update() . If you are using a dataset, then use wix-dataset.save() of the current dataset item after the item has been modified using setFieldValue() or setFieldValues() .

@yisrael-wix Thank you kindly, Yisrael. That is a great starting point. I’ll check it out.

Also, re: viewing that practitioners form . The info you need is: moment-p a s s w o r d – remove spaces