Ext.dataview.component.ListItem
을 사용하여 sencha touch 2.3
(sencha 아키텍트 사용)에 목록을 작성하려고합니다. updateRecord
메서드를 사용하여 상점에서 값을 가져올 수 있었지만 주 구성 요소로 다시 전달할 수는 없습니다.건축가를 사용하여 Sencha 2.3의 DataView 구성 요소 목록 항목
이 내가 달성하기 위해 노력하고 무엇 : -
내가 그 텍스트 저장소에서 동적으로 표시되며 사용자가 클릭 한 경우는 나이가 경고를 표시해야합니다 버튼의 목록을 만들려고합니다. 나는 그 안에 이름과 나이가있는 가게가있다. 클래스 다음
Ext.define('MyListItem.view.MyListItem', {
extend: 'Ext.dataview.component.ListItem',
alias: 'widget.mylistitem',
requires: [
'Ext.Button',
'Ext.MessageBox'
],
config: {
padding: 10,
layout: 'hbox',
items: [
{
xtype: 'button',
handler: function(button, e) {
var record = this.getRecord();
console.log("buttonTapped");
console.log(record);
Ext.Msg.alert(
record.get('name'), // the title of the alert
"The age of this person is: " + record.get('age') // the message of the alert
);
},
text: 'MyButton'
},
{
xtype: 'component',
flex: 1,
html: 'Sample component inside dataitem'
}
]
},
updateRecord: function(record) {
// Provide an implementation to update this container's child items
var me = this;
me.down('button').setText(record.get('name'));
}
});
내 을 dataView 내가 이름을 얻을 수 있어요하지만 난 여기 드리려고 과 관련하여 도움이 필요 경고 setup.I을 얻을 수 없습니다 나는 것은 내 가게입니다 : -
Ext.define('MyListItem.store.MyDirectStore', {
extend: 'Ext.data.Store',
requires: [
'MyListItem.model.MyModel'
],
config: {
data: [
{
name: 'Adam',
age: '28'
},
{
name: 'Eve',
age: '27'
}
],
model: 'MyListItem.model.MyModel',
storeId: 'MyDirectStore'
}
});
감사합니다. 이것은 나를 도왔습니다 – Kapil
@Anubis, 제발 당신이 내 sencha 터치 문제를 좀 봐 주시겠습니까 [여기] (http://stackoverflow.com/questions/22457136/sencha-touch-with-phonegap-using-sencha-cmd-and -phonegap-build-causes-error)? 정말로 감사 할 것입니다. – codin