Description
Parameters for atk4_form
are the following:
->atk4_form($js_method, $param1, $param2, $param3, ...)
As result JS method $js_method
from ui.atk4_form.js
will be called like this:
->$js_method($param1, $param2, $param3, ...)
If method you use is $js_method = 'reloadField'
, then you can have following parameters:
reloadField: function(field_name, url, fn, notrigger, arg)
So you can pass URL arguments in one (or both) of two ways - using url
parameter or using arg
parameter.
Solution
So one of these solutions should work for you.
Pass URL parameters already included in URL (using PHP, wrong approach):
->atk4_form(
'reloadField',
'packaging_id',
$this->api->url(null, array( /* base URL + additional parameters, formatted by PHP */
'color' => $dd1->js()->val(),
'size' => $dd2->js()->val(),
))
)
or generate URL dynamically using JS (this is correct way):
->atk4_form(
'reloadField',
'packaging_id',
$this->api->url(), /* base URL */
null,
null,
array( /* additional parameters formatted by JS */
'color' => $dd1->js()->val(),
'size' => $dd2->js()->val(),
)
)