parky128
28 Apr 2011, 3:04 AM
I got a weird issue where a list component in my app is not displaying data from the store its bound to, the list component is rendering the correct number of rows, so I wonder if I have missed something with my field mappings or something similar somwhere.
I have set up my store like so:
Ext.regModel('Vehicle', {
fields: [
{name: 'untID', type: 'int'},
{name: 'untName', type: 'string'}
]
});
this.TrackingListStore=new Ext.data.Store({
storeId: 'TrackingListStore',
model: 'Vehicle'
});
You will notice I have not confgured a proxy on the store above. This is because I am manually loading in the data elsewhere in the application just through the use of loadData(), I am passing in the following array data:
[[8202,"A13 KCT"],[8201,"A15 KCT"],[8203,"A16 KCT"],[8205,"A18 KCT"],[8200,"A19 KCT"],[8468,"Coach BF60 OFD (906)"],[8469,"EC350389831767135"],[8458,"EC350389835720106"],[8007,"EC350389837573297"],[8169,"ET352929010020026"]]
I am following the same approach as how Ext designer splits out the ui and base functionality into separate classes, so my main ui file for my list component looks like the following:
SBS.Websites.PPMobi.VehicleListUi = Ext.extend(Ext.List, {
store: 'TrackingListStore',
itemTpl: '<div>{untID} - {untName}</div>',
singleSelect: true,
initComponent: function() {
SBS.Websites.PPMobi.VehicleListUi.superclass.initComponent.call(this);
}
});
This list component is an item of a tabpanel like so:
SBS.Websites.PPMobi.Tabpanel = Ext.extend(Ext.TabPanel, {
appHub: null,
fullscreen: true,
ui : 'light',
sortable : true,
items: [
{
title: 'Vehicles',
ui: 'light',
cls : 'card1',
items: [{
xtype: 'vehiclelist'
}]
},
{
title: 'Map',
ui: 'light',
layout: 'fit',
items: [{
xtype: 'map'
}]
},
],
dockedItems: [{
xtype: 'toolbar',
title: 'www.pinpointers.mobi',
dock: 'top',
items: [{
text: 'Logout',
ui: 'light',
handler: function(){
this.appHub.wsClient.EndSession();
},
scope: this
}]
}],
initComponent: function() {
}
});
All I end up with is just the dashes as defined in the itemTpl config for my list component above, but nothing for the untID and untName placeholders. I don't get it, I have stepped through my code and can see my store is loading and can inspect the items collection after it has loaded and can see the records there.
Anyone got any clues for me as to why my list doesn't display the data I am expecting to see?
I have set up my store like so:
Ext.regModel('Vehicle', {
fields: [
{name: 'untID', type: 'int'},
{name: 'untName', type: 'string'}
]
});
this.TrackingListStore=new Ext.data.Store({
storeId: 'TrackingListStore',
model: 'Vehicle'
});
You will notice I have not confgured a proxy on the store above. This is because I am manually loading in the data elsewhere in the application just through the use of loadData(), I am passing in the following array data:
[[8202,"A13 KCT"],[8201,"A15 KCT"],[8203,"A16 KCT"],[8205,"A18 KCT"],[8200,"A19 KCT"],[8468,"Coach BF60 OFD (906)"],[8469,"EC350389831767135"],[8458,"EC350389835720106"],[8007,"EC350389837573297"],[8169,"ET352929010020026"]]
I am following the same approach as how Ext designer splits out the ui and base functionality into separate classes, so my main ui file for my list component looks like the following:
SBS.Websites.PPMobi.VehicleListUi = Ext.extend(Ext.List, {
store: 'TrackingListStore',
itemTpl: '<div>{untID} - {untName}</div>',
singleSelect: true,
initComponent: function() {
SBS.Websites.PPMobi.VehicleListUi.superclass.initComponent.call(this);
}
});
This list component is an item of a tabpanel like so:
SBS.Websites.PPMobi.Tabpanel = Ext.extend(Ext.TabPanel, {
appHub: null,
fullscreen: true,
ui : 'light',
sortable : true,
items: [
{
title: 'Vehicles',
ui: 'light',
cls : 'card1',
items: [{
xtype: 'vehiclelist'
}]
},
{
title: 'Map',
ui: 'light',
layout: 'fit',
items: [{
xtype: 'map'
}]
},
],
dockedItems: [{
xtype: 'toolbar',
title: 'www.pinpointers.mobi',
dock: 'top',
items: [{
text: 'Logout',
ui: 'light',
handler: function(){
this.appHub.wsClient.EndSession();
},
scope: this
}]
}],
initComponent: function() {
}
});
All I end up with is just the dashes as defined in the itemTpl config for my list component above, but nothing for the untID and untName placeholders. I don't get it, I have stepped through my code and can see my store is loading and can inspect the items collection after it has loaded and can see the records there.
Anyone got any clues for me as to why my list doesn't display the data I am expecting to see?