PDA

View Full Version : store refresh/reload ?



zwelch
17 Jun 2011, 6:13 AM
Hello.

I have a list, the store is initially loaded. The loaded data can change at runtime. So I want to store reload. Unfortunately, I fail it. How can I access the store and reload him and the new list?


icestorm.views.teamlist = Ext.extend(Ext.Panel, {
layout: 'card',

initComponent: function() {
this.list = new Ext.List({
grouped: true,
indexBar: true,
itemTpl: '<div>{foo}</div>',
store: new Ext.data.Store({
model: 'team',
getGroupString : function(record) {
return record.get('bar')[0];
},
proxy: new Ext.data.AjaxProxy({
url: 'http://www.****.de/app/json.php?action=team'
,method:'post'
,reader: 'json'
})
,autoLoad:true
}),
listeners: {
selectionchange: {fn: this.onSelect, scope: this}
}
});



this.listpanel = new Ext.Panel({
layout: 'fit',
items: this.list,
dockedItems: [{
xtype: 'toolbar',
title: 'Mannschaft'
}],
listeners: {
activate: { fn: function(){
this.list.getSelectionModel().deselectAll();
Ext.repaint();
}, scope: this }
}
});

this.items = this.listpanel;

icestorm.views.teamlist.superclass.initComponent.call(this);
},

onSelect: function(sel, records){
.....
}
});

Ext.reg('teamlist', icestorm.views.teamlist);


I've tried this:

icestorm.views.teamlist.store.load();
That did not work, but perhaps you see what I mean. What is the right way?

thx

Jack9
18 Jun 2011, 2:34 PM
See my post @ http://www.sencha.com/forum/showthread.php?137584-Refresh-list-in-oreilly-example

tolbahady
18 Jun 2011, 9:56 PM
teamlist is the panel it has no store atribute, teamlist.list is the list so should say


icestorm.views.teamlist.list.store.load();