I wasn’t sure if I should start a new topic on this or not. But I’m stuck again this time on returning a javascript variable back to dash.
my javascript looks like this
$('div[id^=row]').click(function(){
var rowId = $(this).closest('div').attr('id');
Shiny.onInputChange("catSelected", rowId); #(Shiny.) had been removed from the actual js file.
});
Now the Shiny.onInputChange is obviously an R/Shiny component which I catch with a reactive function in R. Is there an equivalent in Dash. looking at the callback functions I’ve tried this
@app.callback(
Output(component_id='my-div', component_property='children'),
[Input('catSelected')]
)
But that obviously doesn’t work as there is no value. Right now I’m just trying to output what I have clicked on as this will be used later to filter out a dataframe, well hopefully.
The end results is if I click on the grid and it returns the id of row_3_2, I need to split that to be able to filter a data frame on the result of the click.
Hope that makes sense.
Thanks
Residnt