Hello, I’m trying to implement unmanaged row dragging and started by trying to get the onRowDrag… function to log something console.
I adapted from:
I’ve tried variations of
"onRowDragEnter"
"onRowDragEnter(event)"
"onRowDragEnter(params)"
{"function": "log('hi')"}
{"function": "log(event)"}
{"function": "log(params)"}
{"function": "onRowDragEnter"}
{"function": "onRowDragEnter(event)"}
{"function": "onRowDragEnter(param"}
But could not get any back. What am I missing? I’ve also tried putting functions in dagAgGridComponentFunctions
Does anyone have a working example I can reproduce?
On the other hand, the follow works just fine
"rowDragText": {"function": "log(params)"}
Source code:
import dash_ag_grid as dag
from dash import Dash, html
app = Dash(__name__)
rowData = [{'name': 'one'}, {'name': 'two'}, {'name': 'three'}]
columnDefs = [{'field': 'name', 'rowDrag': True}]
app.layout = html.Div(
[
dag.AgGrid(
id='row-dragging-unmanaged',
rowData=rowData,
columnDefs=columnDefs,
dashGridOptions={
"rowDragManaged": False,
"onRowDragEnter": {"function": "onRowDragEnter"}
}
),
],
)
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
# dagAgGridFunctions.js
#---------------------------------------------------------------------------------------------
# var dagfuncs = window.dashAgGridFunctions = window.dashAgGridFunctions || {};
# dagfuncs.onRowDragEnter = (e) => {console.log(e)}