2

Is it possible to remove a Super Table row?

I got it to work to add a new row but it would be great if I can remove it later.

Thanks for any help! :)

5
  • With or without php/a custom controller? Commented Apr 11, 2019 at 19:04
  • without a custom controller
    – Samuel
    Commented Apr 11, 2019 at 19:06
  • In that case you need to submit the exact same form just without the row you want to remove. Commented Apr 11, 2019 at 19:36
  • No I got a better solution! If the type of the field is 0 then it is removed! So I solve it with a bit javascript
    – Samuel
    Commented Apr 11, 2019 at 19:38
  • @Samuel can you add what worked for you as an official solution?
    – Brad Bell
    Commented Apr 11, 2019 at 23:30

1 Answer 1

2

I got a solution!

<input class="remove" type="hidden" name="fields[{{ fieldHandle }}][{{ row.id }}][type]" value="{{ blocktype }}">

So the output will be "1" if you change it to "0" and safe your page the row is deleted! Really simple.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.