javascript - Grails using submittoremote and onsuccess -
i can't make onsuccess event works... try use data rendered controller doesn't work.
my gsp code:
<g:submittoremote name="supprimerusr" url="[controller:'user',action:'presupprimeruser']" class="submit" value="${g.message(code: 'liste.user.bouton.supprimer.label')}" update="messageinfoerro" onsuccess="confirmersuppruser(data);"/>
here method in controller "presupprimeruser":
def presupprimeruser () { ... render(status: 200, text: 'haha') ... }
javascript method "confirmersuppruser":
function confirmersuppruser(data) { alert('confirm normal'); alert(data.text + 'haha '+ data.status); }
whatever try doesn't work, have text render in controller, prints "undefined".
how can make work ? didn't find many documentation it.
thank you
Comments
Post a Comment