Skip to content

Commit

Permalink
Merge pull request #52 from mshriver/update-table-row-fill-edit
Browse files Browse the repository at this point in the history
[RFR] Update Table and TableRow fill for row save
  • Loading branch information
Milan Falešník committed Aug 9, 2017
2 parents 68e47cd + ffc89a5 commit eb2ce53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/widgetastic/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,10 @@ def fill(self, value):
else:
self.logger.info('Filling column %r', key)

# if the row widgets aren't visible the row needs to be clicked to edit
if hasattr(self.parent, 'action_row') and getattr(self[key], 'widget', False):
if not self[key].widget.is_displayed:
self.click()
if self[key].fill(value):
changed = True
return changed
Expand Down Expand Up @@ -1654,7 +1658,7 @@ def fill(self, value):
fill_value = copy(fill_value)
fill_value[self.assoc_column_position] = key
if row.fill(fill_value):
self.row_save()
self.row_save(row=row.index)
changed = True
return changed
else:
Expand Down Expand Up @@ -1700,7 +1704,7 @@ def row_add(self):
raise NotImplementedError(
'You need to implement the row_add in order to use dynamic adding')

def row_save(self):
def row_save(self, row=None):
"""To be implemented if the table has dynamic rows.
Used when the table needs confirming saving of each row.
Expand Down

0 comments on commit eb2ce53

Please sign in to comment.