2012-10-26 39 views
0

我需要在使用PullToRefresh sencha touch 2插件刷新我的列表時設置啓動參數(operation.setStart(1))。在PullToRefresh插件中獲取sencha touch 2操作對象

我能做到這一點的onJsonpstoreBeforeLoad函數中就好了,因爲這個函數解析operation參數對象

onJsonpstoreBeforeLoad: function(store, operation, eOpts) { 
    /* some before load operations */ 
    var startIndex = operation.getStart(); 

    /* increase the value of the start-index by one */ 
    operation.setStart(startIndex+1); 
} 

但PullToRefresh插件的「關於刷新」功能中,它只是解析plugin參數,但我需要獲得operation爲了使用setStart()

.... 
refreshFn: function(plugin) { 
    console.log(Ext.data.Operation); 
}, .... 

有誰知道如何獲得當前操作?我可以用plugin.getParent()拿到店裏/代理,但是這並不能幫助:(

回答

1

你可以叫

plugin.up(); 

希望這有助於!

+0

謝謝,這確實讓我獲得列表(是該插件的父)但是我仍然無法獲得操作?具有此方法的唯一類是請求'Ext.Request.getOperation()'..我如何獲得操作以設置'setStart() ' –