I have a custom made data form, with therein a datagrid with multiple fields. I have made the possibility to add entries, in the background adding rows by adding input elements with the correct names:
<input name='field_id_16[rows][new_row_0][col_id_1]' type='text'> <input name='field_id_16[rows][new_row_0][col_id_2]' type='text'>
this checkout the correct field and column names, and everything is going as planned. now I also built in the possibility of deleting, and as long I take care of the 'new_row_x' numbering, this all goes well.
now my problem is when the user deletes all entries. I don't have the form elements anymore (because there should be none - when the user removes all datarows) giving a value, and i don't know how to custom update a datagrid which used to elements, back to being empty...?
anybody knows what to do?