Results 1 to 2 of 2
  1.    #1  

    I am trying to achieve the following: I fetch and parse some JSON, generate a model from it and want to display it in one single scene, grouped by day.

    Each day/group contains the same data model and widgets: some lists, drawers, a few canvas elements.

    I got stuck while thinking how I could generate those widgets in an efficient männer.

    I could of course generate the widget-DOM in a loop in the assistant but I feel that there might be a way to do it with the tools that were meant to render repeating data: lists and templates.

    So my question is: is it possible to put those widgets in a template and render them as list items, then initialize them afterwards?
    Last edited by phoque; 03/29/2011 at 06:02 PM.
  2.    #2  
    I managed to solve my problem by looping through all days and Mojo.View.render()'ing and attaching them to the DOM. Afterwards I initialized an event listener for each iteration and the Widgets contained in the templates (each one got a unique ID on generation).

Tags for this Thread

Posting Permissions