我需要创建一个简单的个人资料页面。每当用户成功登录时,他将被重定向到个人资料页面,其中将显示他/她的信息和照片。我在下面尝试
Ext.define('casta.view.Intro', {
extend: 'Ext.tab.Panel',
xtype:'intro',
//need to call url and render json data to the template below
config: {
tpl: [
'<tpl for=".">',
'<div class="holder">',
'<div class="avatar"><img src="{profile_image_url}" /></div>',
'<div class="h-content">',
'<h2>{user}</h2>',
'<p>{text}</p>',
'</div>',
'</div>',
'</tpl>'
]
}
});
json数据如下
{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 2}, "objects": [{"date_joined": "2012-05-18T15:44:54", "first_name": "", "id": 1, "last_login": "2012-05-18T15:44:54", "last_name": "", "resource_uri": "/api/casta/user/1/", "username": "admin"}, {"date_joined": "2012-05-21T12:05:00", "first_name": "", "id": 29, "last_login": "2012-05-21T12:05:00", "last_name": "", "resource_uri": "/api/casta/user/29/", "username": "sumit"}]}
我需要调用 URL 来返回 json 并将其呈现在模板上。
帮帮我 :)