I have the following situation:
table foo has some basic meta info.
table bar is of the form “field” => “value” and is intended to display custom data. It contains foo_id from table foo. Foo has many bars.
I would like to select foo, but add results of bar into the record.
$conn->render_table(‘foo’, ‘foo_id’,…);
#then maybe create another connector $opt
$opt->render_table(‘bar’, ‘bar_id’, ‘foo_id,name,value’);
#now attach event
$opt->attach(‘beforeRender’, ‘merge_options_in’);
function merge_options_in($item){
# get the right item from $opt
$bar = $opt->some_api_call($item->id); #or something
$item->set($bar->get(‘name’), $bar->get(‘value’));
}
What is the proper code for the above?