PDA

View Full Version : data from store not showing in list view



riches
21 Aug 2013, 11:32 AM
Please the data in my store is not showing in my list view. I am using Sencha Architect 2.1 and i created as follows
Ext.define('MyApp.store.BusTimes', {
extend: 'Ext.data.Store',

alternateClassName: [
'bustimes'
],

config: {
autoLoad: true,
autoSync: true,
data: [
{
bus: '53',
time: '2mins'
},
{
bus: '54',
time: '5mins'
},
{
bus: '55',
time: '7mins'
},
{
bus: '144',
time: '10mins'
},
{
bus: '146',
time: '13mins'
},
{
bus: 'x03',
time: '2mins'
},
{
bus: 'x04',
time: '5mins'
},
{
bus: 'x06',
time: '7mins'
},
{
bus: 'x07',
time: '10mins'
},
{
bus: 'x08',
time: '13mins'
},
{
bus: 'x09',
time: '11mins'
},
{
bus: 'x11',
time: '15mins'
},
{
bus: 'x12',
time: '17mins'
},
{
bus: 'x14',
time: '11mins'
},
{
bus: 'x15',
time: '13mins'
},
{
bus: 'x20',
time: '12mins'
},
{
bus: 'x21',
time: '16mins'
},
{
bus: 'x22',
time: '10mins'
},
{
bus: 'x23',
time: '19mins'
},
{
bus: 'x30',
time: '13mins'
}
],
storeId: 'bustimes',
proxy: {
type: 'memory',
reader: {
type: 'array'
}
},
fields: [
{
name: 'bus'
},
{
name: 'time'
}
]
}
});

and a panel, dataview and template with
Ext.define('MyApp.view.Step12Panel', {
extend: 'Ext.form.Panel',
alias: 'widget.step12',

uses: [
'step4'
],

config: {
items: [
{
xtype: 'dataview',
height: 417,
itemTpl: [
'<div>Data View Item{bus}{time} </div>'
],
store: 'bustimes'
}
]
}

});
all this was done using Sencha Architect.
The store can see my data but it is not shown in the dataview. All that shows in the data view is "Data View Item" written 18 times. The store was set to memory proxy so it could pick the data locally. I guess i need to set the data view to query the database locally but i do not know how. Please some one help i have a short deadline. Please do not refer me to a documentation, i have read them. Thank you.

aconran
22 Aug 2013, 8:15 AM
Set the panel's layout to fit

riches
22 Aug 2013, 3:31 PM
I set the panel to fit and i am still experiencing the same problem. Please help. It just shows data view as the result. I believe it is not seeing the data.

aconran
22 Aug 2013, 4:03 PM
Attach your project and we can take a look at it for you.

Is this panel marked as the initial view?

riches
22 Aug 2013, 4:29 PM
Thank you for your reply. I would like to attach my project but i'm not sure how. I cannot attach the whole project folder and i am not sure the app.html will show without those files. Please advice

riches
22 Aug 2013, 4:31 PM
to answer your question, no the panel is not marked as initial view because there other pages before it.

aconran
22 Aug 2013, 5:48 PM
to answer your question, no the panel is not marked as initial view because there other pages before it.

Does it render properly in the design canvas?

aconran
22 Aug 2013, 5:48 PM
Thank you for your reply. I would like to attach my project but i'm not sure how. I cannot attach the whole project folder and i am not sure the app.html will show without those files. Please advice

File -> Archive Project and then upload the resulting xda

riches
23 Aug 2013, 4:51 AM
I archived the project like you said but i could not upload it because it is too large. 5.6MB to be exact. I even tried zipping the actual file in bits but that still did not work. Is there somewhere else i could upload the project to ? I really need your help as i have a deadline for this project and its very close. :(
To answer the question above, it does render the design canvas properly.

aconran
23 Aug 2013, 10:58 AM
You can send it via email to us architect.feedback at sencha.com.

riches
27 Aug 2013, 5:07 AM
Hi Aconran, I emailed the project to the email address you gave me. I did that last saturday. Please i am really looking forward to hearing your feedback and if you have advice or a tutorial on how to store data locally for viewing on the application or using WAMP server i would really appreciate as most of the tutorials talk about using JSON. Thank you.

aconran
27 Aug 2013, 9:03 AM
Hi Aconran, I emailed the project to the email address you gave me. I did that last saturday. Please i am really looking forward to hearing your feedback and if you have advice or a tutorial on how to store data locally for viewing on the application or using WAMP server i would really appreciate as most of the tutorials talk about using JSON. Thank you.

I just took a look. The problem is that you are using an array reader and provided the data in object/json format.

Go to your store, go to the reader, right click on it and go to the transform menu and change from array to json.

Your data will appear in the dataview (it was never getting loaded into the store).

riches
27 Aug 2013, 9:26 AM
It worked! Thank you very much.:D:)=D>