나는 todos의 목록을 가지고 있으며 나는 그들과 관련된 tag 속성을 가지고있다. 보기에는 "태그로 정렬"단추가 있습니다. 해당 버튼을 누르면 컬렉션이 태그별로 정렬됩니다. 지금 아무 일도 일어나지 않고 있습니다. 아래는 코드입니다. 뭐가 문제 야?SproutCore Collection Sorting
In todos.js I have:
Todos.SortingView = SC.TemplateView.extend({
sortBinding: 'Todos.todoListController.sortTodos'
});
and in todoListController, I have:
sortTodos: function() {
Todos.store.find(Todos.Todo).sortProperty('tag');
}
and in the handlebars view I have:
{{#view Todos.SortingView id="stats"}}
{{#view SC.Button classBinding="isActive" target="Todos.todoListController" action="sortTodos"}}
Sort By Tag
{{/view}}
{{/view}}
{{#collection SC.TemplateCollectionView contentBinding="Todos.todoListController" itemClassBinding="content.isDone"}}
{{view Todos.MarkDoneView}} - Tag - {{content.tag}}
{{/collection}}
귀하의 ListController는 무엇입니까? – hvgotcodes
Todos.todoListController SC.ArrayController.create = ({// 빈 어레이와 어레이 컨트롤러 초기화 함량.] // 함수 sortTodos : 함수() { Todos.store.find (왜 그렇게을 .Todo) .sortProperty ('tag'); }, // functions }); –