Visitor Edit dataset list direct on page?

How can i display a dataset and let visitors/users on the website update and edit data in the dataset.

I know i could create a form to add a new row to the dateaset, but i want the user to see all rows and update a value in some cell´s.

How can this be done?

Noone know how to do this?
I would love to be able to just let the visitors quickly work ina excel-view or something simular… a table where they can edit data.

You can use Repeaters to display a list of all collection rows. Use input components for all fields that you want the users to be able to change.

If there are too many fields to be comfortably handled by a Repeater item, then you can use a Table or a Repeater to list the items, and when the user clicks on a row, it opens up a form to allow the user to change the desired items.

That was neat, looks like it is what i want.

But i can not get it to work.
I have modified a repeater so it contains a label and that label is populated from my database.
Then i have a userinput textbox that is also populated from my database.
All permissions in the database are set to Anyone.
And dataset on my page is set to read-write.
But when i test my page i can not save the data that i type into the textboxes.
Sometimes the data is saved in the top textbox, but never in any of the other textboxes.
How to fix this?

Update: I noticed i need a submit button on each “row” in the repeater. I would love to find a way to not need a button… instead add a “save” or “submit” code to each textbox when it is being changed the data is being saved directly…
But i can not find any working code to ad to the onChange event of the textbox!

Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

I can then inspect and help you make the necessary modifications.

@yisrael-wix
Is this the URL? https://editor.wix.com/html/editor/web/renderer/edit/6829c53e-13c8-4435-8422-f9123d87be29?editorSessionId=32087533-6105-487B-3E76-D3F331A3E75B&metaSiteId=4647b62d-d504-4fad-b62e-fbc7f65955ce&referralAdditionalInfo=TEMPLATE_VIEWER

The page im working on and testing the repeater is called “Testsida”

@oskarkuus All you need to do is to add a Button to the Repeater item. Then connect to Submit:


I tried this out and it works like a charm.

Of course, you can get a lot fancier, but this is a good place to start. Then as you learn more about the Repeater, you can add features and options, and handle other fields.

I hope this helps. Good luck and have fun.

@yisrael-wix
Thank you, but i did find this out that i can add a submit button to the repeater.
But i do not want to the user to need to press a button on each row to save that row. I want the row to save automatically when the textbox is updated.

My idea was to have some kind of code run onChange event of the textbox… so the dataset is saved and updated. Or if not onChange evnet is good to use, some other event…

My goal is to not have a button atleast. I will in the final version have 50+ rows.
Then the user should update all rows with different numbers… i dont want to demand of the user to click on a button on each row!

@oskarkuus You can add an onItemReady() function for this:

Here’s a quickie example:

$w.onReady(function () {
    $w("#repeater1").onItemReady(($item, itemData, index) => {
        $item("#input1").value = itemData.inventeringsvarde;
        $item('#input1').onChange(() => {
            setTimeout($w("#dataset1").save, 1000);
        });
    });
});

You will probably want to add other options and actions, but this should get you started.

@yisrael-wix

Im not very skilled with this coding… i tried to implement it like this:
screenshot: http://prntscr.com/lpo5jp

it seems to work, but it only saves the first row in the repeater.
The other rows are not being saved!

Still cant this to work atall.

I just tried the test page and it works fine. I change a number in an input field of one of the repeaters, click on the OK button, and the new number gets saved to the collection. From what I understand, that’s what you’re trying to do.

Now that you’ve got that working, you can continue working on additional features or UX enhancements.