2
나는 양식 텍스트 필드가있는 팝업 창이 있습니다. 텍스트 필드에 어떻게 액세스 할 수 있습니까? 내 시도는 다음과 같습니다.Sencha Touch 2 양식
function foo(){
bar = Ext.Viewport.add({
xtype: 'panel',
scrollable: true,
centered: true,
width: 400,
height: 300,
items:[{
xtype: 'textfield',
name: 'name',
label: 'Name'
}, {
docked: 'bottom',
xtype: 'titlebar',
items:[{
xtype: 'button',
ui: 'normal',
text: 'Send',
go: 'testsecond',
handler:function(){
alert(bar.getValues().name);
}
}]
}]
});
}
당신은'여기 전화 getCmp' 필요가 없습니다. 당신은 이미'bar' 변수를 사용하여 폼에 대한 레퍼런스를 가지고 있습니다. – rdougan
@rdougan : 죄송합니다. 나는 그 참조를 놓쳤다. 예, 그렇다면'getCmp()'를 호출 할 필요가 없습니다. 내 대답 편집. –
위대한 roadRunner에서 효과가있었습니다. 설명해 주셔서 감사합니다. –