mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:28:37 +02:00
fix for delete of object table row
This commit is contained in:
parent
2a8b002725
commit
d2c7bf4334
1 changed files with 15 additions and 12 deletions
|
@ -474,21 +474,24 @@ function deleteTableRow(delete_glyphicon) {
|
||||||
if (!isArray) {
|
if (!isArray) {
|
||||||
// this is a hash row, so we empty it but leave the hidden input blank so it is cleared when we save
|
// 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.empty()
|
||||||
row.html("<input type='hidden' class='form-control' name='" + table.attr("name") + "' data-changed='true' value=''>");
|
row.html("<input type='hidden' class='form-control' name='"
|
||||||
} else if (table.find('.' + Settings.DATA_ROW_CLASS).length > 1) {
|
+ row.attr('name') + "' data-changed='true' value=''>");
|
||||||
updateDataChangedForSiblingRows(row)
|
|
||||||
|
|
||||||
// this isn't the last row - we can just remove it
|
|
||||||
row.remove()
|
|
||||||
} else {
|
} else {
|
||||||
// this is the last row, we can't remove it completely since we need to post an empty array
|
if (table.find('.' + Settings.DATA_ROW_CLASS).length) {
|
||||||
row.empty()
|
updateDataChangedForSiblingRows(row)
|
||||||
|
|
||||||
row.removeClass(Settings.DATA_ROW_CLASS).removeClass(Settings.NEW_ROW_CLASS)
|
// this isn't the last row - we can just remove it
|
||||||
row.addClass('empty-array-row')
|
row.remove()
|
||||||
|
} else {
|
||||||
|
// this is the last row, we can't remove it completely since we need to post an empty array
|
||||||
|
row.empty()
|
||||||
|
|
||||||
row.html("<input type='hidden' class='form-control' name='" + table.attr("name").replace('[]', '')
|
row.removeClass(Settings.DATA_ROW_CLASS).removeClass(Settings.NEW_ROW_CLASS)
|
||||||
+ "' data-changed='true' value=''>");
|
row.addClass('empty-array-row')
|
||||||
|
|
||||||
|
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
|
// we need to fire a change event on one of the remaining inputs so that the sidebar badge is updated
|
||||||
|
|
Loading…
Reference in a new issue