Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle on_ERROR_CODE in jquery remote function #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

boillodmanuel
Copy link

Hi,

I have update JQueryProvider in order to handle on_ERROR_CODE described in Grails Documentation.
I also add XMLHttpRequest to the onSuccess callback function.

Could you add it to jquery plugin ?

Thanks

Commit message:

Attribute onSuccess: add XMLHttpRequest as third parameters of jquery success function

Attributes on_ERROR_CODE: handled with jquery statusCode (see http://api.jquery.com/jQuery.ajax/)
if ERROR_CODE is 2xx or 304, callback has the same parameters than success function, otherwise callback has the same parameters than error function

Usage Samples

<g:formRemote name="remoteForm" 
    url="[action:'myAction']" 
    on200="jQuery('#div200').html(data)"
    on201="jQuery('#div201').html(data)"
    on404="jQuery('#div404').html(errorThrown)"
>

… success function

Attributes on_ERROR_CODE: handled with jquery statusCode (see http://api.jquery.com/jQuery.ajax/)
if ERROR_CODE is 2xx or 304, callback has the same parameters than success function, otherwise callback has the same parameters than error function
@jameskleeh
Copy link

Why hasn't this been merged?

@boillodmanuel
Copy link
Author

Have someone looked at my pull request ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants