fix for delete of object table row

This commit is contained in:
Stephen Birarda 2014-10-09 15:58:26 -07:00
parent 2a8b002725
commit d2c7bf4334

View file

@ -474,8 +474,10 @@ function deleteTableRow(delete_glyphicon) {
if (!isArray) {
// this is a hash row, so we empty it but leave the hidden input blank so it is cleared when we save
row.empty()
row.html("<input type='hidden' class='form-control' name='" + table.attr("name") + "' data-changed='true' value=''>");
} else if (table.find('.' + Settings.DATA_ROW_CLASS).length > 1) {
row.html("<input type='hidden' class='form-control' name='"
+ row.attr('name') + "' data-changed='true' value=''>");
} else {
if (table.find('.' + Settings.DATA_ROW_CLASS).length) {
updateDataChangedForSiblingRows(row)
// this isn't the last row - we can just remove it
@ -490,6 +492,7 @@ function deleteTableRow(delete_glyphicon) {
row.html("<input type='hidden' class='form-control' name='" + table.attr("name").replace('[]', '')
+ "' data-changed='true' value=''>");
}
}
// we need to fire a change event on one of the remaining inputs so that the sidebar badge is updated
badgeSidebarForDifferences($(table))