user2988508
user2988508

Reputation: 1

Sencha Ext.plugin.PullRefresh

I am having a problem on a list with sencha touch 2.3 . I have set the PullRefresh plugin on my app but when I pull my list down and release it the refreshFn is never called. Here is my code:

plugins: [
        {   xclass: 'Ext.plugin.PullRefresh',
            pullText: '',
            autoSnapBack : false,
            refreshFn: function(callback, plugin) {
                console.log("Pulled");
            },
        }
    ]

Many thanks in advance for your reply

Upvotes: 0

Views: 572

Answers (2)

Gaurav Vachhani
Gaurav Vachhani

Reputation: 349

Use this Function for Using PullRefresh plugin in Sencha.

plugins: [{
xclass: 'Ext.plugin.PullRefresh',
pullRefreshText: 'Getting Refresh...',
refreshFn: function() {
    var store = Ext.getStore('Company');
    store.getProxy().setExtraParam(Sencha App.util.Config.currentCompany);
    Ext.Viewport.setMasked({
        xtype: 'loadmask'
    });
    store.load(function(records, operation, success) {
        Ext.Viewport.setMasked(false);
    });
}}]

Upvotes: 0

evilmandarine
evilmandarine

Reputation: 4543

You need to replace refreshFn: section with this:

listeners:{
    latestfetched: function(eOpts) {
        console.log("Pulled");
    }
}

Upvotes: 1

Related Questions