table.py 515 B

12345678910111213141516171819202122
  1. from typing import Dict
  2. import justpy as jp
  3. from .element import Element
  4. jp.template_options['aggrid'] = False
  5. class Table(Element):
  6. def __init__(self, options: Dict):
  7. """Table
  8. An element to create a table using `AG Grid <https://www.ag-grid.com/>`_.
  9. :param options: dictionary of AG Grid options
  10. """
  11. view = jp.AgGrid(temp=False)
  12. view.options = self.options = jp.Dict(**options)
  13. jp.template_options['aggrid'] = True
  14. super().__init__(view)