Dash AG Grid select row with checkbox and obtain row id or value for specific column

Hello again!

I am on the last step of converting my app from datatable to ag grid.

My grid rows are singly selectable only via a checkbox on the first column:

dashGridOptions={'rowSelection': 'single', 'suppressRowClickSelection': True, 'enableCellTextSelection': True, 'ensureDomOrder': True},

When I click on the checkbox I would like to obtain either the row id or the value of the second column (account).

I have tried the code from the documentation, but it does not seem to work in my case:

@app.callback(Output('feat-importance-individual', 'figure'),
			Output('feat-importance-individual-new', 'figure'),
			Input('full-table', 'selectedRows'),
			Input('shap-values', 'data'),
def individual_importances(shap_values, selected_row):
	if selected_row:
		feat_imp_ind = feat_importance_individual(shap_orig, selected_row['account'])
		feat_imp_ind_new = feat_importance_individual(shap_values, selected_row['account'])		
		return feat_imp_ind, feat_imp_ind_new	
		raise PreventUpdate

Hello @edmoman,

Your inputs are backwards.


Oops. That was embarrassing. Now the syntax from the example works:

acc = selected_row[0][‘account’]