GeoCongress.us App 코드와 처음으로 Sencha Touch 앱을 사용하고 있기 때문에이 앱의 레이아웃 기능에 대한 전제는 내가 성취하고자하는 것과 비슷합니다.Sencha Touch : List ItemTap 이벤트 발생
그래도 itemtap
이벤트에 응답하기 위해 List 개체를 가져 오는 데 문제가 있습니다. 내 의도는 SetsScreen
레벨의 itemtap
이벤트를 캡처하고 내 App
객체가 수신 대기하는 내 맞춤 이벤트를 실행하고 App
은 탭 한 항목을 기반으로 새 카드를 표시하는 프로세스를 처리 할 수 있습니다.
첫째, SetsScreen
오브젝트 (적어도 그것의 관련 부분) :
DataSets.views.SetsScreen = Ext.extend(Ext.Panel, {
cls: 'sets-screen',
layout: 'card',
initComponent: function() {
// Build the main content list and add it to the main scren
this.setsList = new DataSets.views.SetsList({
scroll: false
});
this.setsList.on('itemtap', this.onListItemTap, this);
this.main = new Ext.Container({
scroll: true,
items: [this.setsList]
});
this.items = [this.main];
DataSets.views.SetsScreen.superclass.initComponent.call(this);
},
onListItemTap: function(dv, index, item, e) {
alert('Test');
}
});
이 (여기 아무것도 정말 놀랍) 내 SetsList
오브젝트입니다 :
DataSets.views.SetsList = Ext.extend(Ext.List, {
itemSelector: '.sets-list-item',
singleSelect: true,
initComponent: function() {
this.store = DataSets.stores.Sets;
this.itemTpl = Ext.XTemplate.from('sets-list');
DataSets.views.SetsList.superclass.initComponent.call(this);
}
});
그리고 Sets
목적은 아무것도 아니다 빠른 데이터 모델 및 Ext.data 이상. 스토어 :
Ext.regModel('Sets', {
idProperty: 'id',
fields: [
'title',
'last_updated',
'current_value'
]
});
DataSets.stores.Sets = new Ext.data.Store({
model: 'Sets',
data: [
{id: 0, title: 'Weight', last_updated: new Date('11/28/2010 00:00:00 AM GMT-0600'), current_value: 145},
{id: 1, title: 'Cups of Coffee', last_updated: new Date('11/28/2010 07:00:00 AM GMT-0600'), current_value: 1}
]
});
링크를 가져 주셔서 감사합니다. 이것은 GeoTweets (GeoCongress가 아닌)에 대한 것이지만 어쨌든 단서를 보려고합니다. 그럼에도 불구하고, 나는 유효한 1.0 API 문서를 참조하고 있으며 아무 것도 눈에 띄지 않습니다. –
아니면 이제 "싱카"에서 빠져 나왔습니까? –