我需要创建一个简单的配置文件页面。每当用户成功登录(s)时,他就会被重定向到配置文件页面,在那里他/她的信息和照片将被显示。我在下面尝试。
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(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 并把它在模板上。
帮助我:)