Appending rows in-between from AJAX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Appending rows in-between from AJAX

Esteban A. Maringolo
Is there a way I can pass an generated html to the after() jQuery function?

I have the following html:

<table>
<tr id="id1">...</tr>
<tr id="id2">...</tr>
<tr id="id3">...</tr>
<tr id="id4">...</tr>
</table>

I want that, via a click handler, load another table row after row
with id #id2 or #id3.

If in the following command line works:
$("#id2").after('<tr>...</tr>');


But in Seaside I would like to do something like:
tag onClick: (
  (html jQuery: #id2) after: (html jQuery load html: [:xhr | xhr
tableRow: [ "..."] ])
)

This load the generated html, but appends it to end of the table
instead of doing it after #id2 as I would expect.

Any pointers about this?

I'm trying to build an "expansible" table (drill-down style, like a
tree), but rendering each row children on demand. Maybe there already
exists a component for this purpose.

Regards!

Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Appending rows in-between from AJAX

Ryan Simmons-2
I would try something like

tag onClick: (
  (html jQuery ajax script: [:script | (script jQuery: #id2) after: [:xhr | xhr
tableRow: [ "..."] ] ]
)


On 19 August 2014 06:59, Esteban A. Maringolo <[hidden email]> wrote:
Is there a way I can pass an generated html to the after() jQuery function?

I have the following html:

<table>
<tr id="id1">...</tr>
<tr id="id2">...</tr>
<tr id="id3">...</tr>
<tr id="id4">...</tr>
</table>

I want that, via a click handler, load another table row after row
with id #id2 or #id3.

If in the following command line works:
$("#id2").after('<tr>...</tr>');


But in Seaside I would like to do something like:
tag onClick: (
  (html jQuery: #id2) after: (html jQuery load html: [:xhr | xhr
tableRow: [ "..."] ])
)

This load the generated html, but appends it to end of the table
instead of doing it after #id2 as I would expect.

Any pointers about this?

I'm trying to build an "expansible" table (drill-down style, like a
tree), but rendering each row children on demand. Maybe there already
exists a component for this purpose.

Regards!

Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Appending rows in-between from AJAX

Ryan Simmons-2
I might have forgotten a script add: so if the above does not work try

[:script | script add: ( (script jQuery: #id2) after: [:xhr | xhr
tableRow: [ "..."]) ] ]


On 19 August 2014 07:58, Ryan Simmons <[hidden email]> wrote:
I would try something like

tag onClick: (
  (html jQuery ajax script: [:script | (script jQuery: #id2) after: [:xhr | xhr
tableRow: [ "..."] ] ]
)


On 19 August 2014 06:59, Esteban A. Maringolo <[hidden email]> wrote:
Is there a way I can pass an generated html to the after() jQuery function?

I have the following html:

<table>
<tr id="id1">...</tr>
<tr id="id2">...</tr>
<tr id="id3">...</tr>
<tr id="id4">...</tr>
</table>

I want that, via a click handler, load another table row after row
with id #id2 or #id3.

If in the following command line works:
$("#id2").after('<tr>...</tr>');


But in Seaside I would like to do something like:
tag onClick: (
  (html jQuery: #id2) after: (html jQuery load html: [:xhr | xhr
tableRow: [ "..."] ])
)

This load the generated html, but appends it to end of the table
instead of doing it after #id2 as I would expect.

Any pointers about this?

I'm trying to build an "expansible" table (drill-down style, like a
tree), but rendering each row children on demand. Maybe there already
exists a component for this purpose.

Regards!

Esteban A. Maringolo
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside