Selaa lähdekoodia

use same fix for the "Editable AG Grid" example

Falko Schindler 1 vuosi sitten
vanhempi
säilyke
117a27f0dd
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      examples/editable_ag_grid/main.py

+ 1 - 1
examples/editable_ag_grid/main.py

@@ -14,7 +14,7 @@ rows = [
 
 
 def add_row():
-    new_id = max(dx['id'] for dx in rows) + 1
+    new_id = max((dx['id'] for dx in rows), default=-1) + 1
     rows.append({'id': new_id, 'name': 'New name', 'age': None})
     ui.notify(f'Added row with ID {new_id}')
     aggrid.update()