ember cli pagination как должен работать

377
10 июля 2017, 19:21

Всем привет. Подскажите как правильно установить ember-cli-pagination, что бы он работал.

У меня есть роут:

export default Ember.Route.extend({ 
    controller: null, 
    setupController:function(controller, model) { 
        this._super(controller, model); 
        this.set('controller',controller ); 
        controller.getData() 
    }, 
 
    beforeModel: function() {}, 
 
    perPage: 25, 
 
    model: function(params) { 
 
        return App.New.create({ 
            statuses:[ 
                {id:1, text: "purpose of courier"}, 
                {id:2, text: "Courier Appointed"}, 
                {id:3, text: "On the way to the restaurant"}, 
                {id:4, text: "Arrived at the restaurant"}, 
                {id:5, text: "On the way to the customer"}, 
                {id:6, text: "Arrived to the customer"}, 
                {id:7, text: "Fulfilled"}, 
                {id:8, text: "Canceled"}, 
                {id:9, text: "Removed"} 
            ], 
            loaderMain:false, 
            result: [], 
            count: 0 
        }); 
    }, 
    afterModel: function () { 
        //this.refresh(); 
    } 
 
 
 
});
Парамет result получаю аяксом и изменяю в контроллере.

Есть шаблон:

{{#each model.result as |order index|}}
 ....
{{/each}}
{{page-numbers content=model.result}}

Как "заставить" его работать с параметром model.result в данном случае?

Как изменить код так, что бы по клику на след страницу вызывать controller.getData() ?

READ ALSO
Ошибка ajax скрипта в Firefox, который работает в Google Chrome

Ошибка ajax скрипта в Firefox, который работает в Google Chrome

Друзья, портирую расширение из Chrome на FirefoxУ FF много своих особенностей с которыми нужно как то найти общий язык

411
Как распарсить экранированный json?

Как распарсить экранированный json?

Помогите пожалуйста распарсить json

353
Пишет Uncaught TypeError: Cannot read property 'user' of undefined

Пишет Uncaught TypeError: Cannot read property 'user' of undefined

Браузер при запуске проекта выдает ошибку:

406