I'm trying to execute a javascript code to initialize certain components in my gsp template. I need the script code to be executed after the template is loaded. The template is loaded from a controller. Any idea how this can be achieved?
Code to render the template within the controler:
render(template: 'myTemplate', model:[user:User])
I'm using formRemote to call the controller
<g:formRemote url="[action:'showMeTemplate', controller: 'User']" name= "formName" update="myTemplateDiv">
</g:formRemote>
Try onSuccess
or onComplete
events on the formRemote
tag.