1

I am using listpaging plugin on a list and would like to use it with an 'offset' value. The API that I'm running against doesn't support pagination with 'page' values but rather uses offsets.

If I have a limit of 10 and offset 0, I will get the first 10 records, with limit 10 and offset 10, I will get records 11-20 and so on.

The listpaging plugin though requires a 'page' value. I have tried setting the startParam to 'offset' on my store proxy but this results in loading records 1-11 rather than 11-20.

Any suggestions?

Ext.define('MyApp.store.Retailers', {
    extend: 'Ext.data.Store',

    config: {
        storeId: 'retailersStore',
        model: 'MyApp.model.Retailer',
        pageSize: 10,
        proxy: {
            type: 'ajax',
            method: 'GET',
            url: 'myapp/api/retailers',
            startParam: 'offset',
            reader: {
                type: 'json',
                rootProperty: 'data.entries',
                totalProperty: 'count'
            }
        }
    }
});
4

1 回答 1

0

在这种情况下,您可以添加pageParam: 'customPageParamName'属性,proxy然后瞧。

希望这可以帮助。

于 2014-09-17T09:29:59.763 回答