Clone Button

I think it depends on the implementation requirements of this feature. For example, if you are working with an existing data source from Server Connect (e.g. a database query) you could hook the remove button up to an action that removes rows from the database. But if this is strictly a submission form, then I believe the remove button would need to be associated with an action that targets the row in the table by its index value. This implementation, however, would fundamentally change the way it has been demonstrated so far because right now, we are simply adding/deleting rows based on a counter value.

Yes it can be done dynamically (server-side) quite easily but I was looking for a ‘push’ to array workflow to cut out the necessity of having to use a database for certain information but that may not be possible in Wappler.

Its useful if you are wanting to bind information not held in a database to something like a simple PayPal shopping cart without having to jump through hoops. Sometimes I have the necessity to just pass a list of passenger names, pick-up points off to the client for example, without storing anything in a database.

I guess in time as Wappler goes forward arrays may be given more attention, its still early days, or I could re-think the approach to suit the particular application or workflow being used due to its retrictions. There is usually alternative options and ways around such issues.

1 Like

Removal of a particular row and not just the last one but any row :
Srep 1 - Give your remove button a unique class name “btn-remove”
Step 2 - Create a script using the class name

 <script>
  $('.table tbody').on('click', '.btn-remove ', function() 
  {
    $(this).closest('tr').remove();
    
  });
  </script>

And that’s it

1 Like