<div dir="ltr">Ok.... since we are already in this thread....is there any Javascript expert around?  What I need to do now goes outside my current limits...<div>I have the example I showed in this thread:</div><div><br></div>
<div><div>html anchor</div><div><span class="" style="white-space:pre">        </span>class: &#39;btn btn-default btn-group-xs dropdown-toggle btn-xs&#39;; </div><div><span class="" style="white-space:pre">        </span>onClick:  </div>
<div>                (html jQuery ajax</div><div>                        serialize: (html jQuery: &#39;#reportTableForm&#39;);</div><div><span class="" style="white-space:pre">                                </span>script: [ :s |  </div><div><span class="" style="white-space:pre">                                        </span>self doSomethingThin: anObject.</div>
<div><span class="" style="white-space:pre">                                        </span>s &lt;&lt; ((s jQuery id: (&#39;tr&#39;,(self report indexFor: anObject) asString)) replaceWith:[:r | </div><div><span class="" style="white-space:pre">                                                </span>&quot;here...can I get the text of the href of my THs of the TR of the tableHead?&quot;</div>
<div><span class="" style="white-space:pre">                                                </span>self report reRenderRow: anObject on: r.</div><div><span class="" style="white-space:pre">                                </span> <span class="" style="white-space:pre">                        </span>]).</div><div>
 <span class="" style="white-space:pre">                                                        </span>])</div></div><div><br></div><div>That is an anchor inside a cell of row, that serializes the form, then I do something with the row (anObject) and finally I re-render the row. OK?</div>
<div>Now....the question is...I also have some Javascript lib rendering the table (DataTables) which provides some plugins to, for example, re-order the columns, hide-show columns, etc... The same tool also allows to keep in the session, the &quot;modifications&quot; (columns reorder, hide/show columns etc), so....if the user has reordered columns or hide-show some, when I re-render the row, it is bad because in the server I have the &quot;old&quot; order etc.  The lib may provide a callback or hook to be send whenever the columns are reordered or hidden/shown but that is more complex to implement....   </div>
<div><br></div><div>My columns have href as the &quot;title&quot; (sorting), hence I already have this function:<br></div><div><span style="white-space:pre">                </span><br></div><div><div><span class="" style="white-space:pre">                </span>var getCellText = function (elem) {</div>
<div>                    //get only the element text</div><div>                    return elem.contents().filter(function() {</div><div>                        return this.nodeValue;</div><div>                    }).text();</div>
<div>                };<span class="" style="white-space:pre">        </span></div></div><div><br></div><div>Note that I do know the id of the TR. So I guess I should get the tableHead, then its TR, then get the list of TH and for each call that function. In any case....what I would need is that list and send it as argument to &quot;self report reRenderRow: anObject on: r.&quot;. </div>
<div>The problem is that I need to EXECUTE that javascript, get the return and use that for my re-render.</div><div><br></div><div>Maybe this is not possible...</div><div><br></div><div>Thanks in advance!</div><div><br></div>
<div><br></div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 11, 2014 at 11:10 AM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@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"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">
<div class="">On Fri, Jul 11, 2014 at 10:37 AM, Winfried Jacobs <span dir="ltr">&lt;<a href="mailto:news@winfried-jacobs.de" target="_blank" class="vt-p">news@winfried-jacobs.de</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">(sorry if this message comes up multiple times)<br>
<br>
Hello Mariano,<br>
<br>
JQAjax&gt;&gt;script: ist a callback, so you don&#39;t need both #callback: and #script: .<br>
Instead, you should merge both of your callback blocks into one:<br>
<div><br>
     html jQuery ajax<br>
         serializeChildren: (html jQuery: &#39;#myFormID&#39;);<br>
</div>         script: [ :s |<br>
                 &quot;code from your first #callback: goes in here.&quot;<br>
                 &quot;...&quot;<br>
<div><br>
                 self halt. s &lt;&lt; (s jQuery id: (&#39;tr1&#39;)) replaceWith:[:r | r<br>
html: &#39;mariano&#39; ]<br>
                 ]<br>
<br>
<br></div></blockquote><div><br></div></div><div>Hi Winfried,</div><div><br></div><div>You know...yesterday night, just before going to sleep, I realized that indeed, I could put by &quot;callback code&quot; inside the very same #script: and then from there re-render (replaceWith...) from there. </div>
<div class="">
<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"><div>
<br>
</div>One possible reason why your code doesn&#39;t work: #callback: and #script: are<br>
primary callbacks, but you can only register one primary callback for an ajax<br>
object.<br>
<br></blockquote><div><br></div></div><div>OK, I see. </div><div class=""><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">

However, you could register multiple secondary callbacks like #callback:value:<br>
#callback:json: etc.  But in your case, a secondary<br>
callback is unnecessary.<br>
<br></blockquote><div><br></div></div><div>OK, thanks for the explanation. I will read the web 2.0 chapter of the Dynamic Web Development..otherwise...why did I buy it? hahaha. </div><div><br></div><div>Thanks, </div><div>
<div class="h5"><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>
Cheers<br>
Winfried<br>
<br>
<br>
<br>
&gt; Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@gmail.com</a>&gt; hat am 11. Juli 2014 um 04:23<br>
&gt; geschrieben:<br>
<div>&gt;<br>
&gt;  Well...not there yet...now I am able to render the new table row with all the<br>
&gt;&#39;mariano&#39;. And the row itself seems to reflect changes (the callback of the<br>
&gt;ajax is really executed). The problem now is that I don&#39;t know how to make my<br>
&gt;render script to happen AFTER the callback of the ajax. I tried #script:  ,<br>
&gt;#onComplete: and #onSuccess:  (just in case). What I need is to make the ajax<br>
&gt;call, serialize the form, execute the ajax callback, and then do the replace of<br>
&gt;the tr (with a script).<br>
&gt;   <br>
&gt;  The only one that seems to be executed later is #script: but when I do this,<br>
&gt;the callback of the ajax is not executed.<br>
&gt;   <br>
&gt;  Any ideas?<br>
&gt;   <br>
&gt;  Thanks,<br>
&gt;<br>
&gt;<br>
&gt;  On Thu, Jul 10, 2014 at 6:22 PM, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@gmail.com</a><br>
</div><div>&gt;&lt;mailto:<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@gmail.com</a>&gt; &gt; wrote:<br>
&gt;    &gt; &gt;    ouuuuch<br>
&gt; &gt;     <br>
&gt; &gt;    sorrryyyy by bad hahahhaha. Very funny. I will explain later. Don&#39;t loose<br>
&gt; &gt;your time.<br>
&gt; &gt;     <br>
&gt; &gt;    Best,<br>
&gt; &gt;     <br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;    On Thu, Jul 10, 2014 at 6:00 PM, Esteban A. Maringolo<br>
</div><div>&gt; &gt;&lt;<a href="mailto:emaringolo@gmail.com" target="_blank" class="vt-p">emaringolo@gmail.com</a> &lt;mailto:<a href="mailto:emaringolo@gmail.com" target="_blank" class="vt-p">emaringolo@gmail.com</a>&gt; &gt; wrote:<br>

&gt; &gt;      &gt; &gt; &gt; Maybe you should use #onComplete: instead of #script: in your<br>
&gt; &gt;JQAjax object.<br>
&gt; &gt; &gt;      _______________________________________________<br>
&gt; &gt; &gt;      seaside mailing list<br>
&gt; &gt; &gt;      <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
</div>&gt; &gt; &gt;&lt;mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" class="vt-p">seaside@lists.squeakfoundation.org</a>&gt;<br>
<div><div>&gt; &gt; &gt;      <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>

&gt; &gt; &gt;    &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;     <br>
&gt; &gt;    --<br>
&gt; &gt;    Mariano<br>
&gt; &gt;    <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
&gt; &gt;  &gt;<br>
&gt;<br>
&gt;   <br>
&gt;  --<br>
&gt;  Mariano<br>
&gt;  <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
&gt;  _______________________________________________<br>
&gt;  seaside mailing list<br>
&gt;  <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
&gt;  <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
&gt;<br>
<br>
 <br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="vt-p">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div></div></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>

</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
</div></div></div>