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! :)

  • With or without php/a custom controller? – Robin Schambach Apr 11 at 19:04
  • without a custom controller – Samuel Apr 11 at 19:06
  • In that case you need to submit the exact same form just without the row you want to remove. – Robin Schambach Apr 11 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 Apr 11 at 19:38
  • @Samuel can you add what worked for you as an official solution? – Brad Bell Apr 11 at 23:30
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, privacy policy and cookie policy

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