Re: More advanced DOM manipulation

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

Re: More advanced DOM manipulation

Nicolas Petton
Hi,

I just committed a new branch in Iliad with #append: and #prepend:
methods.

http://github.com/NicolasPetton/iliad/tree/append_prepend

You can do:

aWidget append: anothWidget

and:

aWidget: append: anotherWidget onAnswer: aBlock

When using the js layer, the parent widget won't be rebuilt, only the
widget you append/prepend will be.

Of course you can append/prepend several widgets :)

Cheers!

Nico

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: More advanced DOM manipulation

Eli Green-5
I feel bad that I didn't get that done, but I'm also very pleased that it's in there now. :)

There are two other interesting jQuery functions: .before() and .after() which insert into the DOM before or after the specified element. Using the blog comment example, if you wanted to permit replies to a comment, you could have them immediately inserted after the comment they're replying to.

On Feb 28, 2010, at 16:29, Nicolas Petton wrote:

> Hi,
>
> I just committed a new branch in Iliad with #append: and #prepend:
> methods.
>
> http://github.com/NicolasPetton/iliad/tree/append_prepend
>
> You can do:
>
> aWidget append: anothWidget
>
> and:
>
> aWidget: append: anotherWidget onAnswer: aBlock
>
> When using the js layer, the parent widget won't be rebuilt, only the
> widget you append/prepend will be.
>
> Of course you can append/prepend several widgets :)
>
> Cheers!
>
> Nico

Reply | Threaded
Open this post in threaded view
|

Re: More advanced DOM manipulation

Nicolas Petton
Le dimanche 28 février 2010 à 19:42 +0100, Eli Green a écrit :
> There are two other interesting jQuery functions: .before()
> and .after() which insert into the DOM before or after the specified
> element.

Maybe you could give it a try ;)


Cheers!

Nico

signature.asc (204 bytes) Download Attachment