What I’m trying to do:
I have repeating panel that is displaying rows from a data table. I added a button to be able to insert a row. I would like this row to be inserted right under the selected row and not at the end.
I saw this code in the forum:
But I don’t understand what its doing or how to modify it to fit my need.
Are there any other examples on how to add rows at a set location?
You shouldn’t rely on the insert order in the data tables for displaying them in that order. Instead you add a field to the table that represents the order (e.g. a date if you want it to be displayed chronologically, a title field for alphabetically, a number field if you want an arbitrary order, etc) and then use tables.order_by on that field when you get search results from that table.
I was not aware that row order is not dependable. Thank you both for the clarification. I will add a counter column, or use another method for ordering them.