Vorbly <Code>

CODING MADE EASY WITH VORBLY

WIX CODE REPEATER DELETE ITEM

Need to delete items from your Wix Repeaters? This tutorial will show you how to add a button to delete database items from Wix Repeaters using Wix Code. Your visitors will be able to sort data displayed in your repeaters. We will provide you with the webpage elements and sample codes required to implement this feature.

THE DEMO

1/3

THE ELEMENTS

The Page

Text Elements​

  • Page Title ID: #title

  • Menu Element ID: #text1, #text2, #text3...

Wix Repeater: #repeater1

  • Item Name ID: #items

  • Item Quantity ID: #quantity

  • Unit Price ID: #unitprice

  • Final Price ID: #price

  • Delete Button ID: #delete

Button Elements

  • Confirm Order Button: #OrderNow

The Database

Create a database Items (dynamicDataset).

Recommended fields:

  • Item Name ID: items

  • Item Quantity ID: quantity

  • Unit Price ID: unitprice

  • Final Price ID: price

Then link fields to your repeater.

THE CODE

Page Code

export function delete_click(event, $w) {

        $w("#dynamicDataset").remove();

}

COMMENTS

I'm a paragraph. Click here to add your own text and edit me. It's easy.

No comments. Be the first to leave a comment.

Hi, what if i wanted to delete an entire repeater, as opposed to a single line item?

Adam Catchpole

Jul 24, 2019

1

Hi Adam,

You can try using $w('#repeater1').data=[] to clear all repeater data.

Please note that this will only clear the data displayed in the repeater but will not clear the information in your database.

Hope this helps!

Andrew (Vorbly)

Aug 17, 2019

0

WEB DESIGN & DEVELOPMENT SOLUTIONS

GET PROFESSIONAL HELP