I’m trying to put these buttons inside my GridView:
$extraButtons = array(
'class'=>'CButtonColumn',
updateButtonLabel => 'Atualizar',
deleteButtonLabel => 'Excluir',
viewButtonLabel => 'Visualizar',
deleteConfirmation => 'Deseja realmente excluir este ítem?',
buttons => array(
'btnCVs' => array(
'label'=> 'See resumes',
'url'=> 'javascript:viewResumes($data->id_professional)', //here is the line
'imageUrl' => '/gammarh/assets/dad4ddbc/gridview/cvs.gif',
'visible' => 'true',
)),
template => '{btnCVs} {view} {update} {delete}',
viewButtonOptions => array("target" => "_blank"),
);
I`d like to put a function inside each generated line. When I do that I receive the error:
Parse error: syntax error, unexpected ':' in /Applications/MAMP/htdocs/yiiroot/framework/base/CComponent.php(616)
I`ve already tried to escape the : character, use urlencode.. and nothing.
Somebody knows how to resolve it?
Thanks,
Armando
You should be able to do:
(you can leave out the escaped quotes if you are only passing an id.)
The other option would be to pass a unique id to each button and attach a click event on page load.