我试图与Ember JS DataTable中的jQuery插件。 貌似时刻灰烬尝试更新一些新的数据,DOM,它有一个问题表具有的风格,并插入像搜索栏的一些元素后,Twitter的引导分页页脚等,代码如下
App.TableView = Em.View.extend({
classNames:['table','table-striped','table-bordered','dataTable'],
tagName:'table',
didInsertElement:function (){
this.$().dataTable({
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
}
});
}
});
在车把的用法如下:
{{#view App.TableView }}
{{view App.ListStaffView}}
{{/view}}
该App.ListStaffView中有以下
App.ListStaffView = Ember.View.extend({
templateName: 'list',
staffBinding: 'App.staffController',
showNew: function() {
this.set('isNewVisible', true);
},
hideNew: function() {
this.set('isNewVisible', false);
},
refreshListing: function() {
App.staffController.findAll();
}
});
和列表模板如下:
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
{{#each staff}}
{{view App.ShowStaffView staffBinding="this"}}
{{/each}}
</tbody>
<tfoot>
<div class="commands">
<a class="btn btn-inverse" href="#"{{action "showNew"}}>
<i class="icon-plus"></i>
</a>
<a class="btn btn-inverse" href="#"{{action "refreshListing"}}>
<i class="icon-refresh"></i>
</a>
</div>
</tfoot>
加载此错误后就是这个样子
错误:无法在的Metamorph执行操作
我做了数据表集成与零配置和失败。 由于灰烬无法将数据插入到DOM,JQuery的数据表口口声声说“无数据”