quantopian / qgrid

An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
Apache License 2.0
3.04k stars 425 forks source link

grid does not support add_rows on an empty dataframe. Could we stop the user from removing the last row? #366

Open camilog04 opened 3 years ago

camilog04 commented 3 years ago

Environment

Description of Issue

Reproduction Steps

  1. initialize the qgrid widget with one row
  2. show the widget with the tool bar option
  3. delete all the rows
  4. click the 'add_row' button ...

What steps have you taken to resolve this already?

A solution to this is to prevent the users from deleting the rows. This can be accomplished by adding an empty check to the remove_rows method:

Anything else?

Another solution is that when the dataframe is empty there is a constroctor of a 'default' row but but this would be more difficult to scale. ...