<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: 'btn btn-default btn-group-xs dropdown-toggle btn-xs'; </div><div><span class="" style="white-space:pre">        </span>onClick: </div>
<div> (html jQuery ajax</div><div> serialize: (html jQuery: '#reportTableForm');</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 << ((s jQuery id: ('tr',(self report indexFor: anObject) asString)) replaceWith:[:r | </div><div><span class="" style="white-space:pre">                                                </span>"here...can I get the text of the href of my THs of the TR of the tableHead?"</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 "modifications" (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 "old" 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 "title" (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 "self report reRenderRow: anObject on: r.". </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"><<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@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"><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"><<a href="mailto:news@winfried-jacobs.de" target="_blank" class="vt-p">news@winfried-jacobs.de</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">(sorry if this message comes up multiple times)<br>
<br>
Hello Mariano,<br>
<br>
JQAjax>>script: ist a callback, so you don'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: '#myFormID');<br>
</div> script: [ :s |<br>
"code from your first #callback: goes in here."<br>
"..."<br>
<div><br>
self halt. s << (s jQuery id: ('tr1')) replaceWith:[:r | r<br>
html: 'mariano' ]<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 "callback code" 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'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>
> Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@gmail.com</a>> hat am 11. Juli 2014 um 04:23<br>
> geschrieben:<br>
<div>><br>
> Well...not there yet...now I am able to render the new table row with all the<br>
>'mariano'. And the row itself seems to reflect changes (the callback of the<br>
>ajax is really executed). The problem now is that I don't know how to make my<br>
>render script to happen AFTER the callback of the ajax. I tried #script: ,<br>
>#onComplete: and #onSuccess: (just in case). What I need is to make the ajax<br>
>call, serialize the form, execute the ajax callback, and then do the replace of<br>
>the tr (with a script).<br>
> <br>
> The only one that seems to be executed later is #script: but when I do this,<br>
>the callback of the ajax is not executed.<br>
> <br>
> Any ideas?<br>
> <br>
> Thanks,<br>
><br>
><br>
> On Thu, Jul 10, 2014 at 6:22 PM, Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@gmail.com</a><br>
</div><div>><mailto:<a href="mailto:marianopeck@gmail.com" target="_blank" class="vt-p">marianopeck@gmail.com</a>> > wrote:<br>
> > > ouuuuch<br>
> > <br>
> > sorrryyyy by bad hahahhaha. Very funny. I will explain later. Don't loose<br>
> >your time.<br>
> > <br>
> > Best,<br>
> > <br>
> ><br>
> ><br>
> > On Thu, Jul 10, 2014 at 6:00 PM, Esteban A. Maringolo<br>
</div><div>> ><<a href="mailto:emaringolo@gmail.com" target="_blank" class="vt-p">emaringolo@gmail.com</a> <mailto:<a href="mailto:emaringolo@gmail.com" target="_blank" class="vt-p">emaringolo@gmail.com</a>> > wrote:<br>
> > > > > Maybe you should use #onComplete: instead of #script: in your<br>
> >JQAjax object.<br>
> > > _______________________________________________<br>
> > > seaside mailing list<br>
> > > <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" class="vt-p">seaside@lists.squeakfoundation.org</a><br>
</div>> > ><mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank" class="vt-p">seaside@lists.squeakfoundation.org</a>><br>
<div><div>> > > <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>
> > > > ><br>
> ><br>
> > <br>
> > --<br>
> > Mariano<br>
> > <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><br>
> > ><br>
><br>
> <br>
> --<br>
> Mariano<br>
> <a href="http://marianopeck.wordpress.com" target="_blank" class="vt-p">http://marianopeck.wordpress.com</a><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>
><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>