0

有人能告诉我为什么这个人的名单在使用时没有重新排序吗

sortProperties: ['name'], sortAscending: false

我正在使用 ember-1.0.0-rc.6 和 ember 数据存储版本 13 和 DS.FixtureAdapter

App.Person = DS.Model.extend({
name: DS.attr('string'),
trackNumber: DS.attr('number'),
})

App.Person.FIXTURES = [
{id: 1, name: 'aron face', trackNumber: 2},
{id: 2, name: 'bob sinclair', trackNumber: 1}
];

App.PersonsRoute = Ember.Route.extend({
model: function() {
return App.Person.find();
}
});

App.Router.map(function() {
this.resource('persons', function() {
this.resource('person', { path: ':person_id' });
});
});

App.ApplicationController = Ember.Controller.extend();

App.PersonsController = Ember.ArrayController.extend({
sortProperties: ['name'],
sortAscending: false,

newPerson: function(){
    App.Person.createRecord({id: new Date().getTime(), name: 'Created person'});
},
remove: function () { .... }
});

App.personView = Em.View.extend({ ... });
4

0 回答 0