I want to use cellClick to get the column details in a dash_tabulator. But it is showing me none when I am using cellClick in another callback.
table = dash_tabulator.DashTabulator(
id=table_id,
data=data_records,
columns=table_columns,
downloadButtonType= download,
# clearFilterButtonType={"css": "btn btn-outline-dark", "text": "Clear Filters"},
options={
# "groupBy": "Type",
"layout": "fitColumns",
"printAsHtml": True,
"printStyled": True,
"dataTree": True,
"dataTreeStartExpanded": True,
"dataTreeChildIndent": 15,
'selectable': selectable,
'autoResize': True,
# 'maxHeight': "auto",
'maxWidth': 300,
'clipboard': True,
'rowFormatter':tabulator_ns('treeFormatter'),
'cellClick':tabulator_ns('cellClick'),
"headerVisible": True,
"printConfig":{"formatCells":True},
}
I am also using javascript callbacks for cellClick , code as shown here.
cellClick:function(e, cell){
alert("cellClick"+ cell.getColumn().getDefinition().field+ cell.getColumn().getDefinition().title);
// // alert(cell.getValue())
// // console.log("cellClick"+ cell.getColumn().getDefinition());
var data = {'field': cell.getColumn().getDefinition().field,
'title': cell.getColumn().getDefinition().title}
// // alert(data)
// table.props.setProps({cellClick: 'field'})
// cell.props.setProps({cellClick: 'field'})
// alert(cell._cell.data)
return data
}
And here is new callback where I am using this cellClick property.
@app.callback(
[
Output('pl-modal', 'is_open')
],
[
Input('pl-table', 'rowClicked'),
Input('pl-table', 'cellClick'),
],
prevent_initial_call=True
)
def show_pl_modal(selected_row, selected_cell ):
print("rowselected", selected_row)
print("cellselected", selected_cell)
I am getting required data in javascript alert but getting none for cellselected in new callback.