Доработка. Исправлен вылет при нажатии удалить.
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user