bokeh-js-callback-to-select-table-rows-based-on-selection-from-another-table

I have two bokeh tables and I would like to click on a table record in the first table and select rows in the second table based on matching values from in field. created a js callback script to:

create an empty list to hold indices from table2 that match records in table 1 collected to selected indices of table 1

loop over the indices in table 1 and collect value to compare to table 2 loop over table 2 and append the indices if the table id’s match.

nothing is happening when I run the the script and select on the table. appreciate any help.

code =     """
var select_indices = []
var cdata = cb_obj.data;
var pdata = psrc.data;
var indices = cb_obj.selected.indices;
for (var i=0; i < indicies.length; i ++){
var hh_id = cdata['hh_id'][i]
for (var j = 0; j < pdata['hh_id'].length; j++){
if(pdata['hh_id'][j] == hh_id){
select_indices.push(j)
}
}
}
psrc.selected.indices = select_indices;
psrc.trigger('change');
"""

hh_src.callback = CustomJS(args=dict(psrc=per_src), code=code)