PDA

View Full Version : Refresh List component



fwilson
3 Jan 2011, 8:43 AM
Hi,

I'm new to Sencha Touch. To get up to speed on the framework, I'm creating an app similar to the GeoCongress demo.

The app basically consists of a list of data, returned from a server. Clicking the data loads a second page with details about the selected list item. This is all working as expected.

The problem I'm having is with the Refresh button. When clicked, the event fires, the server is hit and the callback is executed, but the list does not refresh. I'm sure it's a simple fix, but I can't seem to figure out what I'm missing.

The refresh function and the associated callback are listed below.

Any help would be greatly appreciated.

Again, thanks for the help,

Fielding



onRefreshTap: function(){
this.getClients(this.form.getValues());
this.refreshIcon.setDisabled(true);
},
getClients: function(credentials){
this.toolbar.setTitle('Loading Clients...');
ppm.ClientService.getClientsByFirm(credentials, this.loadClientStore, this)
},
loadClientStore: function(clients){
this.refreshIcon.setDisabled(false);
this.toolbar.setTitle('Clients');
ppm.stores.Clients.loadData(clients);
this.list.doComponentLayout();
Ext.repaint;
}

fwilson
3 Jan 2011, 8:59 AM
Figures I'd find the answer as soon as I posted to the forum :-P

I modified the signature of the store.loadData to explicitly set append to "false" and that fixed the issue.


ppm.stores.Clients.loadData(clients, false);

Thanks,

Fielding