json 파일을로드하려고 할 때 Sencha Touch selectfield에서 실제로로드 할 값을 얻는 데 문제가 있습니다.Sencha Touch의 selectfield에 json 데이터 추가
Ext.regModel('d', {
fields: [{
name: 'Name', type: 'string'
}, {
name: 'id', type: 'int'
}]
});
Ext.regStore('TempStore', {
model: 'd',
autoLoad: true,
proxy: {
type: 'ajax',
url: '/sampledata.json',
reader: {
type: 'json',
root: 'd'
}
}
});
items: [{
xtype: 'selectfield',
label:'My Field',
id: 'Test',
name: 'Name',
store: 'TempStore',
displayField: 'Name',
valueField: 'id',
placeHolder: 'Select a Value'
}
내가의 .js 파일과 같은 폴더에 samepledata.json 파일을 가지고 있고, 페이지가로드 미세하지만 난 selectfield을 누르면이 함께 제공됩니다
내 코드의 관련 부분은 빈 목록.
아이디어가 있으십니까?
편집 : 오타
흠, 시도해 보니 페이지가로드되지 않습니다. – Calvin
대신 Ext.regstore를 시도하십시오. var TempStore = new Ext.data.Store ({model : 'd', autoLoad : true, proxy : .....}); – riship89
흠, 아직 작동하지 않습니다. (라이브 예제의 경우 http://selectout.net/oil/app/을 확인한 다음 왼쪽에있는 데이터 추가를 클릭하고 상단에 예고편 설정을 클릭하면 해당 필드가있는 페이지로 이동합니다). 도움에 감사드립니다. 정말 고맙습니다. – Calvin