2

我有一个image

 items: [
{
    xtype: 'image',
    name: 'img',
    src: '#',
    flex: 1
}]

我从服务器(PHP)加载数据,比如

Mypanel.down('form').getForm().load({ 
...
});

和服务器一样

$temp['img'] = mysqli_real_escape_string($connect,"http://www.sencha.com/assets/images/sencha-avatar-64x64.png");
$results['success'] = true;
$results['data'] = $temp;
print json_encode($results);

一切正常,除了xtype='image'那不起作用。

如何从服务器加载 srcxtype: image谢谢

4

1 回答 1

-1

埃文已经在评论中提到。您可以image在加载表单时设置 src,即 on on form event actioncomplete

这就是我在代码中的做法:

actioncomplete: function(form, action) {
    // get image component by querying it and set src
    this.queryById('user-image').setSrc(action.result.data.userImage);
}
于 2013-09-18T07:38:18.443 回答