-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Enhance Pynecone with data grid functionality #468
Comments
Nice suggestion I'll take a look at this it may be better than gridjs. I'll get back to you on this |
AG grid is great~ |
Is there any update on this? The current datatable implementation lacks some important features IMHO; the most prominent being that you can't trigger event handlers by selecting rows/columns. |
Any update on this? This feature is highly appreciated. It would allow us to implement many other use cases. Maybe someone could help me out how to implement all the event handlers / callbacks. The following code at least displays the grid already. Maybe we could take a look how it got implemented in another python project. from typing import Any, Callable, List, Set
import pynecone as pc
import os
from pynecone.var import Var
class AgGrid(pc.Component):
library = "ag-grid-react"
tag = "AgGridReact"
columnDefs: Var[list]
rowData: Var[list]
animateRows: Var[bool] = True
enableRangeSelection: Var[bool] = True
rowSelection: Var[str] = "multiple"
defaultColDef: Var[dict] = {
"editable": True,
"sortable": True,
"flex": 1,
"minWidth": 100,
"filter": True,
"resizable": True,
"headerComponentParams": {
"menuIcon": "fa-bars",
},
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@staticmethod
def on_cell_value_changed(event: dict[str, Any]):
# Handle the event here
print(f"Cell value changed: {event}")
@classmethod
def get_controlled_triggers(cls) -> dict[str, pc.Var]:
return {"onCellValueChanged": pc.EVENT_ARG}
def _get_imports(self):
return {}
def get_custom_code(self) -> Set[str]:
return {
"import { AgGridReact } from 'ag-grid-react';",
"import 'ag-grid-community/styles/ag-grid.min.css';",
"import 'ag-grid-community/styles/ag-theme-alpine.css';",
}.union(super().get_custom_code()) |
@Alek99 |
Working on a better datatable, probably won't be ready for the next release this Friday, but the one after next Friday should be out. |
@Alek99 |
Oh nice will check it out. Thanks for the suggestion |
Any update on this? This functionality just keeps holding me back from switching over from Streamlit. |
And thus the native hue of resolution |
Hi Pynecone team,
Brilliant work so far. To take datatables to the next level, we need something like javascript data grid. I have doing some research and AG Grid can be one of the options. Have also been using it in streamlit as part of its components. This solves a lot of the smaller asks and opened issues that I am seeing here.
AG Grid is a fully-featured and highly customizable JavaScript data grid. It delivers outstanding performance and has no 3rd party dependencies and integrates smoothly with React as React Component
Features
Besides the standard set of features you'd expect from any grid:
Here are some of the features that make AG Grid stand out:
The features marked with an asterisk are available in the enterprise version only
Please let me know if this makes sense and should we wrap the react ag grid component. Will need help as this component looks complex
The text was updated successfully, but these errors were encountered: