parky128
19 Oct 2010, 3:06 AM
Hi,
I have a problem getting an array store to reload data from my configured proxy. I'm trying to make use of the read method on my unitStore object on my toolbar refresh button handler:
buildStore: function() {
unitStore = new Ext.data.Store({
autoLoad: true,
model: "Unit",
proxy: {
type: 'ajax',
url : 'GetData.ashx',
reader: {
type: 'array',
root: 'data',
idProperty: 'UntID'
}
},
listeners: {
'load': function() {
if(UIBuilt==false)this.buildUI()
}, scope:this
}
});
unitStore.sort('LastUpdateDTUTC', 'DESC');
},
buildUI : function() {
map = new Ext.Map({
title: 'Map',
getLocation: true,
mapOptions: {
zoom: 12
}
});
timeline = new Ext.List({
title: 'Detail',
store: unitStore,
scroll: 'vertical',
cls: 'unitList',
tpl: tpl,
autoHeight:true,
itemSelector: 'div.unit',
singleSelect: true
});
panel = new Ext.TabPanel({
fullscreen: true,
animation: 'slide',
items: [map, timeline]
});
var tabBar = panel.getTabBar().add([{
flex:1
},{
xtype:'button',
ui: 'action',
text: 'Refresh',
handler: unitStore.read()
//iconCls: 'refresh'
}]);
panel.getTabBar().doLayout();
unitStore.each(this.addMarker);
map.map.fitBounds(bounds);
UIBuilt = true;
}
But I get an error in Chrome saying Object has no method 'call', being thrown from the depths of the touch debug js file.
I only used the read method as I came across this in other forum posts, but see it's not in the API docs, is there a different method I should be using to refresh my store?
I did try out the load method but get the same error message thrown.
Thanks, Rob
I have a problem getting an array store to reload data from my configured proxy. I'm trying to make use of the read method on my unitStore object on my toolbar refresh button handler:
buildStore: function() {
unitStore = new Ext.data.Store({
autoLoad: true,
model: "Unit",
proxy: {
type: 'ajax',
url : 'GetData.ashx',
reader: {
type: 'array',
root: 'data',
idProperty: 'UntID'
}
},
listeners: {
'load': function() {
if(UIBuilt==false)this.buildUI()
}, scope:this
}
});
unitStore.sort('LastUpdateDTUTC', 'DESC');
},
buildUI : function() {
map = new Ext.Map({
title: 'Map',
getLocation: true,
mapOptions: {
zoom: 12
}
});
timeline = new Ext.List({
title: 'Detail',
store: unitStore,
scroll: 'vertical',
cls: 'unitList',
tpl: tpl,
autoHeight:true,
itemSelector: 'div.unit',
singleSelect: true
});
panel = new Ext.TabPanel({
fullscreen: true,
animation: 'slide',
items: [map, timeline]
});
var tabBar = panel.getTabBar().add([{
flex:1
},{
xtype:'button',
ui: 'action',
text: 'Refresh',
handler: unitStore.read()
//iconCls: 'refresh'
}]);
panel.getTabBar().doLayout();
unitStore.each(this.addMarker);
map.map.fitBounds(bounds);
UIBuilt = true;
}
But I get an error in Chrome saying Object has no method 'call', being thrown from the depths of the touch debug js file.
I only used the read method as I came across this in other forum posts, but see it's not in the API docs, is there a different method I should be using to refresh my store?
I did try out the load method but get the same error message thrown.
Thanks, Rob