roundlake/joosy — Issue #4: Appending @widget after page load in partial does not actually make a widget
Author: GearHead90
Created: 2012-02-05 16:26:51+00:00
State: open

I have a template for page:

%section.items
!= @render '/shared/items', items: @items

and '/shared/items' is:

- if @items.length > 0
- @items.each (item) =>
!= @widget 'article', -> new ItemWidget(item)
- else
!= @render '/shared/no_items'

When items are loaded with this partial during page load, it is OK. But when I'm trying to append items with this partial during pagination with

@itemsContainer.append @render '/shared/items', items: items

@widget creates 'article' tags, but does not call function (second parameter), so widgets are not rendered. I understand, that it is caused by the fact, that we can create widget only when tag container is appended to DOM. But possibility to make described actions would be pretty cool.