Hello,
i am trying to create a button in DetailView that calls a javascript.
This javascript, then calls(ajax) a custom Controller action to retrieve some data.
To do this the javascript function needs to have as input the id of record.
I’ve tried this without luck:
function display()
{
$this->dv->defs['templateMeta']['form']['buttons'][101] = array (
'customCode' => '<input title="Activate" accesskey="{$APP.LBL_PRINT_PDF_BUTTON_KEY}" class="button" onClick="javascript:activate({$fields.id.value});" name="activate" value="Activate" type="button">');
parent::display();
}
The returned error putting {$fields.id.value} as input is:
Uncaught SyntaxError: identifier starts immediately after numeric literal
How can i pass id of field into javascript funcion?
Many thanks