jupyterlab/lumino

DataGrid: how to live sort/should we be able to get the column size?

krassowski opened this issue · 1 comments

I would like to sort my data grid while preserving column sizes. Currently:

  • The built-in JSONModel does not offer any way of modifying the data once it is constructed. The _data is private rather than protected so I cannot subclass without using @ts-ignore which is a bad practice.
  • I can hot-swap the model which with a new JSONModel, which works but:
    • does not preserve column sizes and there is no public DataGrid method to retrieve column sizes (there is one to set column sizes)
    • has a potential performance penalty
  1. Is there an obvious way I missed?
  2. Should the datagrid support sorting columns by default?
  3. Should we make _data protected in JSONModel and friends?
  4. Should we DataGrid expose a way to get current column sizes?

I was wrong, there is in fact DataGrid.columnSize method.