<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 8:24 PM, Paul DeBruicker <span dir="ltr"><<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">What jQuery version?<br>
<br>
It might be because the #onAjaxStart: and #onAjaxStop: methods should only<br>
be set on the document for some jQuerys (e.g. >= version 1.8) see:<br>
<a href="http://api.jquery.com/ajaxStart/" target="_blank">http://api.jquery.com/ajaxStart/</a><br>
<br></blockquote><div><br></div><div>Thanks Paul. I am using 1.11.0. So if I understand what you mean, I guess I should do instead:</div><div><br></div><div><div><span class="" style="white-space:pre">        </span>html </div><div><span class="" style="white-space:pre">                </span>div </div><div><span class="" style="white-space:pre">                        </span>style: 'display:none';</div><div><span class="" style="white-space:pre">                        </span>class: 'quuveLoading';</div><div><span class="" style="white-space:pre">                        </span>script: (<b>html jQuery document </b></div><div><span class="" style="white-space:pre">                                </span>onAjaxStart: (html jQuery this show);</div><div><span class="" style="white-space:pre">                                </span>onAjaxStop: (html jQuery this hide));</div><div><span class="" style="white-space:pre">                        </span>with: 'Loading...'</div></div><div> </div><div><br></div><div>right? still not working thought :(</div><div><br></div><div>I tried even a simple 'alert(''aa'');' but still not getting called..</div><div><br></div><div>Thanks anyway. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<br>
<br>
<br>
Mariano Martinez Peck wrote<br>
<div><div class="h5">> Hi guys,<br>
><br>
> My app has a some code (thanks Esteban Lorenzano for sharing it with me)<br>
> to<br>
> show a little "Loading..." banner... That is:<br>
><br>
> renderAjaxLoadingDivOn: html<br>
> html<br>
> div<br>
> style: 'display:none';<br>
> class: 'loading';<br>
> script: (html jQuery this<br>
> onAjaxStart: (html jQuery this show);<br>
> onAjaxStop: (html jQuery this hide));<br>
> with: 'Loading...'<br>
><br>
><br>
> Now...it works well for some explicit parts where I use ajax. However, it<br>
> doesn't work for the JQAutocomplete. It my case, the callback to the<br>
> autocomplete can take some seconds. It seems #onAjaxStart: is NOT<br>
> intercepting what the autocomplete os doing. Could it be because<br>
> autocomplete is doing a getJson actually?<br>
><br>
> The key code of the autocomplete is:<br>
><br>
> search: aSearchBlock labels: aLabelsBlock callback: aCallbackBlock<br>
> "A one argument block aSearchBlock that will be evaluated with the term<br>
> the<br>
> user currently typed. The block is expected to answer a collection of<br>
> objects. aLabelsBlock should answer a string label to be displayed for<br>
> each<br>
> object. aCallbackBlock is evaluated with the selected object and an ajax<br>
> script to be performed."<br>
> | term mapping |<br>
> mapping := IdentityDictionary new.<br>
> "assigments to temps don't work in GS 2.4'<br>
> <a href="http://code.google.com/p/glassdb/issues/detail?id=221" target="_blank">http://code.google.com/p/glassdb/issues/detail?id=221</a>"<br>
> term := WAValueHolder new.<br>
> self source: ((self jQuery getJson<br>
> callback: [ :value | term contents: value ]<br>
> value: (JSStream on: 'request.term');<br>
> text: [ :stream |<br>
> stream json: ((aSearchBlock value: term contents) asArray collect: [<br>
> :object |<br>
> GRSmallDictionary new<br>
> at: 'label' put: (aLabelsBlock value: object);<br>
> at: 'index' put: (mapping at: object ifAbsentPut: [ mapping size + 1 ]);<br>
> yourself ]) ];<br>
> onSuccess: 'response(arguments[0])';<br>
> dataType: 'jsonp') asFunction: #('request' 'response')).<br>
> self onSelect: ((self jQuery ajax<br>
> callback: [ :value | term contents: value greaseInteger ]<br>
> value: (JSStream on: 'ui.item.index');<br>
> script: [ :script |<br>
> mapping keysAndValuesDo: [ :object :value |<br>
> value = term contents<br>
> ifTrue: [ aCallbackBlock value: object value: script ] ] ])<br>
> asFunction: #('event' 'ui'))<br>
><br>
><br>
> Any help would be very appreciated.<br>
><br>
> Thanks,<br>
><br>
> --<br>
> Mariano<br>
> <a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
><br>
</div></div>> _______________________________________________<br>
> seaside mailing list<br>
<br>
> seaside@.squeakfoundation<br>
<br>
> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.world.st/JQAutocomplete-and-onAjaxStart-tp4787505p4787543.html" target="_blank">http://forum.world.st/JQAutocomplete-and-onAjaxStart-tp4787505p4787543.html</a><br>
Sent from the Seaside General mailing list archive at Nabble.com.<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
</div></div>