Note that there are some explanatory texts on larger screens.

plurals
  1. POOutput of icanhaz.js templete is [object Array] instead of the rendered template
    primarykey
    data
    text
    <p>I am using Zepto.js, ICanHaz.js, and Backbone.js. I have a couple of templates that I am trying to render. After rendering the template and inserting the result into the page, the only output that I seeing is [object Array] or [object HTMLTableElement].</p> <p>Here is the backbone.js Router</p> <pre><code>InspectionsRouter = Backbone.Router.extend({ routes: { "signin": "signin", "orders": "orders" }, signin: function() { var signinForm = new SignInForm(); $('div#content').html(signinForm.render()); }, orders: function() { InspectionsApp.active_orders = new Orders(); InspectionsApp.active_orders.fetch({ success: function() { var order_list = new OrderList({ collection: InspectionsApp.active_orders }); $('div#content').html(order_list.render()); }, error: function() { Dialog.error("Unable to Load Active Orders"); } }); } }); </code></pre> <p>The first template is static and has no data inserted. Here is code</p> <pre><code>SignInForm = Backbone.View.extend({ render: function() { this.el = ich.sign_in_form({}); return this.el; } }); </code></pre> <p>The other template is somewhat more complicated.</p> <pre><code>var OrderList = Backbone.View.extend({ tagName: 'table', id: 'order_list', initialize: function() { _.bindAll(this, 'render'); }, render: function() { var active_orders = {}; active_orders.orders = this.collection; $(this.el).html(ich.order_list(active_orders)); return this.el; } }); </code></pre> <p>The actual templates aren't very complicated. The first is a simple sign in form. The next is a table.</p> <p>Here is the first template.</p> <pre><code>&lt;script id="sign_in_form" type="text/html"&gt; &lt;h2 class="page_title"&gt;Sign In&lt;/h2&gt; &lt;form action="action/login.php" method="post" id="frm_login" name="frm_login"&gt; &lt;fieldset id="credentials"&gt; &lt;ol&gt; &lt;li class="login"&gt; &lt;label for="email"&gt;E-mail Address&lt;/label&gt; &lt;input type="email" name="email" id="email" tabindex="1" required&gt; &lt;/li&gt; &lt;li class="login"&gt; &lt;label for="password"&gt;Password&lt;/label&gt; &lt;input type="password" name="password" id="password" tabindex="2" required&gt; &lt;/li&gt; &lt;/ol&gt; &lt;/fieldset&gt; &lt;button class="button" id="btn_sign_in" type="submit" tabindex="3"&gt;&lt;img src="icons/door_in.png"&gt;Sign In&lt;/button&gt; &lt;/form&gt; &lt;/script&gt; </code></pre> <p>Here is the second template.</p> <pre><code>&lt;script id="order_list" type="text/html"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;E-mail&lt;/th&gt; &lt;th&gt;Status&lt;/th&gt; &lt;th&gt;Created&lt;/th&gt; &lt;th&gt;Assigned To&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody id="order_list_body"&gt; {{#orders}} &lt;tr&gt; &lt;td&gt;{{last_name}}, {{first_name}}&lt;/td&gt; &lt;td&gt;{{email}}&lt;/td&gt; &lt;td&gt;{{status}}&lt;/td&gt; &lt;td&gt;{{created_at}}&lt;/td&gt; &lt;td&gt;{{assigned_to}}&lt;/td&gt; &lt;/tr&gt; {{/orders}} &lt;/tbody&gt; &lt;/script&gt; </code></pre> <p>Any help would be appreciated. The problem seems to be with ICanHaz or in Backbone. I have tried alerting this.el from with the render method and still get the same issue.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload