【发布时间】:2014-08-05 06:42:18
【问题描述】:
所以我有这个查询可以为我提取数据:
App.ListRoute = Ember.Route.extend({
model: function() { return $.getJSON('php/getlines.php'); }});
我在我的手柄栏中有这段代码来显示它:
<tbody>
{{#each content}}
{{view App.lineItem contextBinding="this"}}
{{/each}}
</tbody>
我正在考虑让我的 html 字段成为一个按钮,单击该按钮会对条目进行排序:
<th class="center"{{action 'sortBy' 'invoice'}}>Invoice</td>
哪里有排序功能:
sortBy: function(property) {
this.set('sortProperties', [property]);
this.set('sortAscending', !this.get('sortAscending'));
}
但是,我不断收到此错误:
错误:没有处理事件“sortBy”。
如果我单击该按钮,我不确定如何对条目进行排序?
【问题讨论】:
标签: sorting ember.js filter javascript