Sencha touch 如何在sencha touch2中创建可见列表

Sencha touch 如何在sencha touch2中创建可见列表,sencha-touch,sencha-touch-2,Sencha Touch,Sencha Touch 2,我是新来sencha touch2的。我想要在页面中显示列表。绑定正在成功进行。但我不能看到数据,但可以滚动页面。任何人都可以帮助我。我面临这个问题。多谢各位 我的代码在这里: Ext.define("Sencha.view.ProjectListView", { extend: 'Ext.form.Panel', xtype: 'projectListepage', id: 'projectListepage', requires: [

我是新来sencha touch2的。我想要在页面中显示列表。绑定正在成功进行。但我不能看到数据,但可以滚动页面。任何人都可以帮助我。我面临这个问题。多谢各位

我的代码在这里:

Ext.define("Sencha.view.ProjectListView", {
    extend: 'Ext.form.Panel',    
    xtype: 'projectListepage',
    id: 'projectListepage',
    requires: [
        'Ext.data.JsonP'
    ],
    config: {
        scrollable: true,
        items: [{
            xtype: 'panel',
            id: 'JSONP'
        },
            {
                docked: 'top',
                xtype: 'toolbar',
                flex: 3,
                items: [{
                    text: 'Project Deatils',
                    handler: function () {
                        var list = Ext.getCmp('JSONP'),
                        tpl = new Ext.XTemplate([
                            '<tpl for=".">',
                                   '<img src="{MainImageUrl}"/><label>{ProjectName}</label><p class="temp_low">{ShortDescription}</p>', //                                                                    
                            '</tpl>',
                    ]);
                        Ext.data.JsonP.request({
                            url: 'http://localhost:53985/PropertyService.svc/GetAllProject',
                            callbackKey: 'callback',
                            params: {

                            },
                            callback: function (success, request) {
                                var project = request;
                                if (project) {
                                    list.updateHtml(tpl.applyTemplate(project));
                                }
                                else {
                                    alert('There was an error retrieving the weather.');
                                }
                            }
                        });
                    }
                }]
            }]
    }
});
Ext.define(“Sencha.view.ProjectListView”{
扩展:“Ext.form.Panel”,
xtype:'ProjectListPage',
id:“ProjectListPage”,
要求:[
“Ext.data.JsonP”
],
配置:{
可滚动:对,
项目:[{
xtype:'面板',
id:'JSONP'
},
{
停靠:“顶部”,
xtype:'工具栏',
弹性:3,
项目:[{
文本:“死亡计划”,
处理程序:函数(){
var list=Ext.getCmp('JSONP'),
tpl=新的Ext.XTemplate([
'',
“{ProjectName}

{ShortDescription}

”,// '', ]); Ext.data.JsonP.request({ 网址:'http://localhost:53985/PropertyService.svc/GetAllProject', callbackKey:'callback', 参数:{ }, 回调:函数(成功,请求){ var项目=请求; 国际单项体育联合会(项目){ list.updateHtml(tpl.applyTemplate(项目)); } 否则{ 警报('检索天气时出错'); } } }); } }] }] } });
在您的代码示例中,我没有看到创建列表的地方。您需要扩展
'Ext.List'
或使用
xtype:'List'
。sencha touch 2文档中有几个简单的示例,介绍了如何创建列表