Доработка. Исправлен вылет при нажатии удалить.

This commit is contained in:
MaD_CaT
2023-08-18 11:11:32 +03:00
parent 1c37f64ed7
commit ceaec55b69
4 changed files with 43 additions and 29 deletions

View File

@@ -362,6 +362,7 @@ func on_btn_add(table):
var row = threat.update_rows()
table.add_row(TABLE_ROW_TYPES)
table.set_row_text(table.get_rows_count()-1, row)
table.set_node_user_data(0, table.get_rows_count()-1, threat)
init_opt_btns(table.get_rows_count()-1, table)
table.connect_columns(self, 'text_submitted', 'on_edit_entry', TABLE_ENTRY_COLUMNS, [])
table.connect_columns(self, 'item_selected', 'on_item_selected', COLUMN_OPT_BTN, [])
@@ -374,6 +375,9 @@ func on_btn_del(table):
var cell = table.get_node2(0, row_i[0])
treats.erase(cell.text)
table.remove_row(row_i[0])
for i in table.get_rows_count():
var treat = table.get_node_user_data(0, i)
treat.row_id = i
func pop_id():