Using JavaScript to Fire Callbacks

I’m investigating using the n_clicks property based on the example you have posted here

is-there-a-way-to-only-update-on-a-button-press-for-apps-where-updates-are-slow

However what isn’t clear at the moment is how do I know what div to target as the input since the id’s are generated during the initialization with this code

#Class that defines the row div for the cards to be added to
def gridRow(r, col, df):
    card = []
    for c in range(1, int(col(0).item()) + 1):
        card.append(makeCard(r, c, df))
    return html.Div(card, className = 'row', id = str(r))

#Class which defines the data that makes up the cards
def makeCard(r, c, df):
    tempDf = pd.DataFrame(df[(df.col_index == c) & (df.grp == r)][['GameCategory','UCount']])
    return html.Div([
        html.Div([
            html.Div([
                html.Div(tempDf['GameCategory'], className = 'boxHeader'),
                html.Div('LTD Unique Users:', className = 'boxLabel'),
                html.Div(tempDf['UCount'], className = 'boxNumbers')
            ], className = 'boxText')
        ], className = 'innerBox' )
    ], className = 'cardBox', id= '_'.join(['row', str(r), str(c)]))

Basically I end up with a 6 x 3 grid, which populates with data that I’m pushing to it. So the divs will have an id range between row_1_1 and row_3_6. However these numbers can change based on the data supplied to it. So in order to know which one to target I would need to know which one I clicked on, unless what you are saying is I need to create a callback for each iteration which wouldn’t make a lot of sense to do unless i’m missing something.

As for creating the plugin, I’ll need to look into that further based on the example on how to do this.