我使用以下代码显示sencha面板。我想要做的是使用json从CMS中提取内容。我试图获得填充'html:'的响应的所有内容都失败了。也许我只是不明白范围?
App.views.howAttend = Ext.extend(Ext.Panel, {
initComponent: function () {
var resp = Ext.Ajax.request({
scope: this,
url: 'mobile-request/pages/how-attend',
success: function ( response ) {
var obj = Drupal.parseJson( response.responseText );
console.log(obj); // this is as expected
//this.html = obj.data doesn't work, neither does using obj.data below, in html:
},
failure: function ( response ) {
console.log (' server error ' + response.status);
}
})
//console.log(this);
App.views.howAttend.superclass.initComponent.call(this);
},
html: 'Nothing'// need to get html returned to here
});
答案 0 :(得分:0)
您需要使用:
YourPanel.update(response.responseText);
成功函数内部