macs
27 Apr 2012, 11:38 AM
hi i can see everywhere that the pull to refresh plugin is working. unfortunately i seem to be not able to get it to work. i am using a store to populate a list. when i use a regular refresh button and execute the store load method when the button is tapped everything works fine/ i get the loading message and the list is updated. with the pull to refresh plugin, nothing is obviously executed after releasing the list. the text and graphics are rendered as they should however the updatedata event is not fired and the list is not refreshed. i also hoped i could simply bind to something like a "release" event which i can listen to and do the shop load method manually, but there is no such event. at least in the docs there is no such event/ or did i miss anything? what is it that i am doing wrong?
the store gets defined like this
Ext.define('VB1.store.MyListStore', {
extend: 'Ext.data.Store',
config: {
storeId: 'vbMyStore',
model: 'VB1.model.MyModel',
autoLoad: true,
proxy: {
type: 'jsonp',
url : 'myUrl.js?',
reader: {
type: 'json',
rootProperty: 'array.resources'
},
},
},
});
the list looks like this:
Ext.define('VB1.view.MyListView', {
extend: 'Ext.dataview.List',
alias: 'widget.mylistview',
requires: [
'Ext.dataview.List','Ext.plugin.PullRefresh',
],
config: {
plugins: [
{
xclass: 'Ext.plugin.PullRefresh',
pullRefreshText: 'Pull down to Refresh!'
}
],
scrollable: 'vertical',
loadingText: "loading...",
emptyText: '</pre><div>No notes found.</div><pre>',
itemTpl: '</pre><div>{title}</div><pre>',
listeners: {
updatedata: function (me, newData, eOpts ) {
console.log(newData)
}
},
},
});
i finally instantiate the view like so:
var myListView = {
xtype: 'mylistview',
store: 'vbMyStore',
}
Ext.Viewport.add([myListView]);
the store gets defined like this
Ext.define('VB1.store.MyListStore', {
extend: 'Ext.data.Store',
config: {
storeId: 'vbMyStore',
model: 'VB1.model.MyModel',
autoLoad: true,
proxy: {
type: 'jsonp',
url : 'myUrl.js?',
reader: {
type: 'json',
rootProperty: 'array.resources'
},
},
},
});
the list looks like this:
Ext.define('VB1.view.MyListView', {
extend: 'Ext.dataview.List',
alias: 'widget.mylistview',
requires: [
'Ext.dataview.List','Ext.plugin.PullRefresh',
],
config: {
plugins: [
{
xclass: 'Ext.plugin.PullRefresh',
pullRefreshText: 'Pull down to Refresh!'
}
],
scrollable: 'vertical',
loadingText: "loading...",
emptyText: '</pre><div>No notes found.</div><pre>',
itemTpl: '</pre><div>{title}</div><pre>',
listeners: {
updatedata: function (me, newData, eOpts ) {
console.log(newData)
}
},
},
});
i finally instantiate the view like so:
var myListView = {
xtype: 'mylistview',
store: 'vbMyStore',
}
Ext.Viewport.add([myListView]);