I am performing an ajax call from a .gsp file in grails:
$.ajax({
async: false,
url: '<g:createLink controller="mycontroller" action="myaction"/>',
data: params,
dataType: 'json',
contentType: 'application/json; charset=utf-8',
onSuccess: 'toggleSaveButton(false);'
});
mycontroller
def myaction() {
// do some funky stuff with params
// params are available, everything here works without a problem
}
outcome
the ajax call is performed and the controller function is called correctly with all attached data.
issue
my onSuccess:
is ignored and never called
i already tried
- using the more generic
onComplete
- change the
onSuccess:
tofunction(){toggleSaveButton(false);}
render (true as JSON)
in my controller action