-1
Sencha Touch2를 처음 사용하고 프록시를 사용하기 전에 간단한 스토어에서 임의의 데이터를로드하여 앱을 시작하려고합니다. . 내보기가 표시되지만 데이터가 채워지지 않습니다. 이 질문을 보았지만 해결하는데 도움이되는 것은 없습니다. 어떤 도움과 인내도 감사합니다. 감사합니다 adavance!뷰에서로드 할 스토어에서 데이터를 가져올 수 없습니다.
내 모델
Ext.define('SenchaFirstApp.model.Distributors', {
extend: 'Ext.data.Model',
config: {
fields: [
{name: 't', type: 'string'},
{name: 'distr', type: 'string'},
{name: 'group', type: 'string'},
{name: 'site', type: 'string'},
{name: 'status', type: 'string'},
{name: 'actuve', type: 'string'},
{name: 'assigned', type: 'string'},
{name: 'state', type: 'string'},
{name: 'schedule', type: 'string'},
{name: 'finished', type: 'string'} ],
}
});
내보기
var distrStore = Ext.create('SenchaFirstApp.store.DistributorStore');
Ext.define('SenchaFirstApp.view.DistributorView', {
extend: 'Ext.dataview.DataView',
requires: [distrStore, 'Ext.data.Store', 'Ext.dataview.List'],
model: 'SenchaFirstApp.model.Distributors',
xtype: 'mainlist',
fullscreen: true,
config:
{
fullscreen: true,
layout: 'fit',
border: 5,
title: 'Distributors',
html: 'My datalist',
autoLoad: true,
items:{
title: 'Setup',
xtype:'list',
store: distrStore,
fields: [
{
text: 'T',
width: 1,
sortable: false,
hideable: false,
dataIndex: 't'
},
{
text: 'Distributor',
width: 50,
sortable: false,
hideable: false,
dataIndex: 'distr'
},
{
text: 'Group',
width: 20,
sortable: false,
hideable: false,
dataIndex: 'group'
},
{
text: 'Site Name',
width: 20,
sortable: false,
hideable: false,
dataIndex: 't'
},
{
text: 'Status',
width: 5,
sortable: false,
hideable: false,
dataIndex: 'status'
},
{
text: 'Active',
width: 5,
sortable: false,
hideable: false,
dataIndex: 'active'
},
{
text: 'State',
width: 2,
sortable: false,
hideable: false,
dataIndex: 'state'
},
{
text: 'Scheduled',
width: 10,
sortable: false,
hideable: false,
dataIndex: 'schedule'
},
{
text: 'Finished',
width: 10,
sortable: false,
hideable: false,
dataIndex: 'finished'
}
]
}
}
});
distrStore.load();
내 가게
Ext.define('SenchaFirstApp.store.DistributorStore', {
extend: 'Ext.data.Store',
requires: ['SenchaFirstApp.model.Distributors', 'Ext.dataview.DataView'],
config: {
// xtype: 'distrlist',
storeId: 'mainlist',
model: 'SenchaFirstApp.model.Distributors',
autoLoad: true,
data: [
{t: 'S', distr: 'Smart Systems', site: 'Smart Temps', status: "done", active: 'Yes', assigned: 'Me', state: 'IN', schedule: 'today', finished: 'today'},
{t: 'I', distr: 'People', site: 'This One', status: "done", active: 'Yes', assigned: 'You', state: 'NC', schedule: 'yesterday', finished: 'tomorrow'}
]}});
는
Ext.Loader.setConfig({enabled:true});
Ext.application({
name: 'SenchaFirstApp',
stores: ['DistributorStore'],
models: ['Distributors'],
views: ['DistributorView'],
requires: ['SenchaFirstApp.view.DistributorView', 'Ext.dataview.DataView', 'SenchaFirstApp.model.Distributors', 'SenchaFirstApp.store.DistributorStore', 'Ext.dataview.List'],
launch: function() {
Ext.fly('appLoadingIndicator');
Ext.Viewport.add(Ext.create('SenchaFirstApp.view.DistributorView'));
}
app.js
});
감사의 말에 감사드립니다. 그러나 제안 된 변경 사항을 모두 적용했지만 데이터가 표시되지 않고 두 행을 구분하는 선이 사라졌습니다. 너는 내가 아직 빠진 것을 볼 수 있니? 다시 한번 감사드립니다. 도움에 감사드립니다.나는 내가하고있는 방식에 대한 단 하나의 견본을 찾을 수 없었으므로 아마도 좋지 않은 다른 예를 함께 섞어 보았다 :/ – codeMagic
나는 내 storeId ('mainlist')를 사용하여 내 상점을 참조했다. 내 견해와 나는 분리 선을 돌려 받았고 오류는 없지만 여전히 데이터가 없다. – codeMagic
마침내! 어떤 이유로 든 내 구성 레이아웃을 'vbox'로 변경 했으므로 그 사실을 인식하지 못했습니다. 일단 나는 그것을 '적합'으로 되돌려 놓았다. 그것은 효과가있다. 이제 몇 가지 심각한 형식 문제가 있지만 이제는 사용할 데이터가 있습니다. 도와 주셔서 다시 한 번 감사드립니다! – codeMagic