Comrades, the Octobrists, help, please.
Here's a page in the admin panel (model Route + the pivots for the City and Sight)
Everything is fine, when click Add Sight - offers a list of available Sight, click on one, go to the configuring additional fields Pivot table.
nothing clever but render the button from the widget, I came up with:
Here it is connected to plugins/xdim/tripmagik/models/routesightpivot/fields.yaml
label: Time from the start to the sight
label: Add time
label: Basic add. price
label: Default stay time
label: Min. stay time
label: Price per quarter of hour
label: You may try to get data from Google Maps API
commentAbove: Make sure you have entered a Google Maps API key
I can assign the button an ajax handler, but here begins the most obscure: in the handler in the controller or the widget get such data from the POST:
Can izvratitsya, to generate the desired data on the basis of available, post back and already in the admin trivial js code to update the field values. But I have a feeling that it's not native and costalism some.