0
sencha touch 2.4에서 작업 중이며 탭 ID로 지정된 탭에서 ajax 요청을 원합니다. 내 아약스 기능을 호출하려면 어떻게해야합니까? 아니면 탭 ID로 지정된 탭을 클릭했을 때만 요청을받을 수 있습니까? Ext.define
을 사용하여 패키지 및 앱보기를 정의합니다.Sencha Touch 2에서 탭 변경시 Ajax 요청하기
내 코드 :
config: {
tabBarPosition: 'bottom',
items: [
{
id: 'tab',
title: 'Home',
iconCls: 'home',
styleHtmlContent: true,
scrollable: true,
items: {
docked: 'top',
xtype: 'titlebar',
title: 'MyTab'
}
}
]
}
내 요청 기능 :
request: function() {
Ext.Ajax.request({
url: 'http://www.example.com'
method: 'GET',
callback: function(options, success, response) {
Ext.ComponentQuery.query('#id')[0].setHtml(response.responseText);
}
});
}
나를 위해 작동하지 않습니다. – developer
답변을 업데이트했습니다. 죄송합니다. 그것이 작동하지 않는 이유를 조사하십시오. – Scriptable
Ext.application이 아닌 Ext.define을 사용하고 싶습니다. – developer