On Miércoles, 3 de Marzo de 2010 22:47:55 Alex escribió:
> I'm using jQuery 1.3.2 and the current version of jRails. I'm
> integrating with Spree, which requires jQuery.
>
> I'm getting the following error after submitting the AJAX update
> form. I'm testing this with a stripped down layout with only this
> content:
>
> <%= javascript_include_tag 'prototype', 'effects', 'jquery-1.3.2.min'
> %>
> <%= active_scaffold_includes %>
> <script type='text/javascript'>jQuery.noConflict();</script>
> <%= yield %>
>
> Everything else is the default active_scaffold template.
>
> The element named existed when the update form was displayed, but has
> been removed already when this error occurs, so it is trying to access
> it a second time.
>
> This is the error printed to the Firebug console:
>
> $("as_admin__mail_templates-update-1-loading-indicator") is null
>
> No stacktrace is printed so this is hard to trace, but it seems to be
> causing other javascript to not execute.
>
> Anyone know what is causing this?
In prototype, $("as_admin__mail_templates-update-1-loading-
indicator").style.visibility = 'hidden' is executed from onComplete callback
of Ajax.Request. In prototype, onComplete callback is executed before the
javascript response, where form and indicator is removed from the document.
Ajax.Request and onComplete callback are set by rails generators
(form_remote_tag).
Probably with jRails onComplete callback is executed after the javascript
response, so you get that error. The only code which won't be executed shold
be Form.enable("as_admin__mail_templates-update-1-form"), so AS should work
for you.
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en.