ember.js - Emberjs create a table with CollectionView -
i wanted generate table array have in controller don't understand how collectionview working.
here array :
app.applicationview = ember.view.extend({ accountprofile: null, // actions: { [...] //action initialize accountprofile (object) } })
my array accessible => view.accountprofile.dialinnumbers when want display on template.
so have table, must respect standards :
<table class="table-history"> <tr> <td class="col-left">+44734567890</td> <td> <div class="ph-img"></div> </td> <td> <div class="tr-img"></div> </td> </tr> </table>
most have in <tr>
tag must generated view. have first <td>
change array in view. others <td>
meant same every row.
my problem don't know how can manage create collectionview , add different class name others <td>
in same row..
i have seen people doing : myview.appendto('.table-history');
or :
{#collection app.myview}} <td>{{content}}</td> {{/collection}}
but i'm kinda lost in this..
[edit]
i manage make works :
app.callbacklistview = ember.collectionview.extend({ tagname: 'tbody', content: ['a','b','c'] }) {{#collection app.callbacklistview}} <td class="col-left">{{content}}</td> <td> <div class="ph-img"></div> </td> <td> <div class="tr-img"></div> </td> {{/collection}}
but have 1 problem here, there display in {{content}}. don't understand this..
Comments
Post a Comment