<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">&lt;<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>&gt;</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. &gt;= 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: &#39;display:none&#39;;</div><div><span class="" style="white-space:pre">                        </span>class: &#39;quuveLoading&#39;;</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: &#39;Loading...&#39;</div></div><div> </div><div><br></div><div>right? still not working thought :(</div><div><br></div><div>I tried even a simple &#39;alert(&#39;&#39;aa&#39;&#39;);&#39; 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">&gt; Hi guys,<br>
&gt;<br>
&gt; My app has a some code (thanks Esteban Lorenzano for sharing it with me)<br>
&gt; to<br>
&gt; show a little &quot;Loading...&quot; banner... That is:<br>
&gt;<br>
&gt; renderAjaxLoadingDivOn: html<br>
&gt; html<br>
&gt; div<br>
&gt; style: &#39;display:none&#39;;<br>
&gt; class: &#39;loading&#39;;<br>
&gt; script: (html jQuery this<br>
&gt; onAjaxStart: (html jQuery this show);<br>
&gt; onAjaxStop: (html jQuery this hide));<br>
&gt; with: &#39;Loading...&#39;<br>
&gt;<br>
&gt;<br>
&gt; Now...it works well for some explicit parts where I use ajax. However, it<br>
&gt; doesn&#39;t work for the JQAutocomplete. It my case, the callback to the<br>
&gt; autocomplete can take some seconds. It seems #onAjaxStart: is NOT<br>
&gt; intercepting what the autocomplete os doing. Could it be because<br>
&gt; autocomplete is doing a getJson actually?<br>
&gt;<br>
&gt; The key code of the autocomplete is:<br>
&gt;<br>
&gt; search: aSearchBlock labels: aLabelsBlock callback: aCallbackBlock<br>
&gt; &quot;A one argument block aSearchBlock that will be evaluated with the term<br>
&gt; the<br>
&gt; user currently typed. The block is expected to answer a collection of<br>
&gt; objects. aLabelsBlock should answer a string label to be displayed for<br>
&gt; each<br>
&gt; object. aCallbackBlock is evaluated with the selected object and an ajax<br>
&gt; script to be performed.&quot;<br>
&gt;  | term mapping |<br>
&gt; mapping := IdentityDictionary new.<br>
&gt; &quot;assigments to temps don&#39;t work in GS 2.4&#39;<br>
&gt; <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>&quot;<br>
&gt; term := WAValueHolder new.<br>
&gt; self source: ((self jQuery getJson<br>
&gt; callback: [ :value | term contents: value ]<br>
&gt; value: (JSStream on: &#39;request.term&#39;);<br>
&gt; text: [ :stream |<br>
&gt; stream json: ((aSearchBlock value: term contents) asArray collect: [<br>
&gt; :object |<br>
&gt; GRSmallDictionary new<br>
&gt; at: &#39;label&#39; put: (aLabelsBlock value: object);<br>
&gt; at: &#39;index&#39; put: (mapping at: object ifAbsentPut: [ mapping size + 1 ]);<br>
&gt; yourself ]) ];<br>
&gt; onSuccess: &#39;response(arguments[0])&#39;;<br>
&gt; dataType: &#39;jsonp&#39;) asFunction: #(&#39;request&#39; &#39;response&#39;)).<br>
&gt; self onSelect: ((self jQuery ajax<br>
&gt; callback: [ :value | term contents: value greaseInteger ]<br>
&gt; value: (JSStream on: &#39;ui.item.index&#39;);<br>
&gt; script: [ :script |<br>
&gt; mapping keysAndValuesDo: [ :object :value |<br>
&gt; value = term contents<br>
&gt; ifTrue: [ aCallbackBlock value: object value: script ] ] ])<br>
&gt; asFunction: #(&#39;event&#39; &#39;ui&#39;))<br>
&gt;<br>
&gt;<br>
&gt; Any help would be very appreciated.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; --<br>
&gt; Mariano<br>
&gt; <a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
<br>
&gt; seaside@.squeakfoundation<br>
<br>
&gt; <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>