sencha没有在面板中看到列表 [英] sencha don't seeing the list in a panel

查看:211
本文介绍了sencha没有在面板中看到列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不明白为什么我在tab3中看不到我的列表...

Hi I don't understand why I don't see my list in tab3...


这是我的代码...
我在myStore中添加一个记录,但是我没有看到列表...

This is my code... I add one record in myStore but I don't see the list...

提前感谢!

    var mainForm ;
var mainFormPanel={};
var addToXml=function (values){};
var htmlTemplate='<p>{b}</p><p>{m}</p><p>{f}</p>';
var template = new Ext.Template(htmlTemplate);


var myStore = Ext.create('Ext.data.Store', {
    storeId: 'MyStore',
    fields: [
             {name: 'id', type: 'string'},
             {name: 'c', type: 'string'},
             {name: 'd', type: 'string'},
             {name: 'q', type: 'string'},
             {name: 'n', type: 'string'}
             ]
}); // create()
myStore.add({id:"id",c:"222",d:"333",q:"444",n:"555"});

var listpanel;

var config={
        glossOnIcon: false,
        autoMaximize: false,
        icon: {
            57: 'lib/sencha-touch/resources/icons/icon.png',
            72: 'lib/sencha-touch/resources/icons/icon@72.png',
            114: 'lib/sencha-touch/resources/icons/icon@2x.png',
            144: 'lib/sencha-touch/resources/icons/icon@114.png'
        },
        phoneStartupScreen: 'lib/sencha-touch/resources/loading/Homescreen.jpg',
        tabletStartupScreen: 'lib/sencha-touch/resources/loading/Homescreen~ipad.jpg',

        //next we require any components we are using in our application.
        requires: [
                   'Ext.tab.Panel',
                   'Ext.form.*',
                   'Ext.field.*',
                   'Ext.Button',
                   'Ext.data.Store'
                   ],

                   launch: function() {            
                       var list= Ext.create("Ext.NavigationView",{
                               xtype: 'list',
                               itemTpl: 'D:{id} - C:{c}',
                               store: myStore,
                               fullscreen: true,
                               layout:'fit',
                               title:'listtitle',
                               onItemDisclosure: function (record, btn, index) {
                                   view.push({
                                       xtype: 'panel',
                                       renderTo: document.body,
                                       layout:'fit',
                                       title: 'second view',
                                       html: 'second view',
                                       styleHtmlContent: true
                                   });
                               }
                       });


                       var myTitle= {
                                       xtype: 'titlebar',
                                       id: 'myTitle',
                                       docked: 'top',
                                       title: 'mytitle'//,
                                    };
                       var myMean={ 
                                       xtype: 'titlebar',
                                       id: 'myMean',
                                       docked: 'bottom',
                                       title: 'myMean'
                                   };


                       listpanel = new Ext.Panel({
                           xtype:'panel',
                           header:true,
                           layout: 'fit',   // important to make layout as 'fit'
                           id:'listpanel',
                           title:'listpanel',
                           items: [myTitle,myMean,list]
                       });


                        var view = Ext.create("Ext.NavigationView", {
                           layout:'fit',
                           id:'view',
                           items: [listpanel]
                       });

                       Ext.Viewport.add({
                           xtype: 'tabpanel',
                           tabBarPosition: 'bottom',
                           items: [
                                   {
                                       title: '1-tab',
                                       layout:'fit',
                                       iconCls: 'home',
                                       html:'tab1',
                                        cls: 'card1'

                                   },
                                   {
                                       title: '2-tab',
                                       layout:'fit',
                                       iconCls: 'download',
                                       html:'tab2',
                                       cls: 'card2'
                                   },
                                   {
                                       title: '3-tab',
                                       layout:'fit',
                                       iconCls: 'home',
                                       items: [view],
                                       cls: 'card3'
                                   },
                                   {
                                       title: '4-tabs',
                                       layout:'fit',
                                       iconCls: 'home',
                                       html: '4-tab',
                                       cls: 'card4'
                                   }
                                   ]
                       });
        }
};
Ext.application(config);


推荐答案

解决删除全屏:true,layout:'fit'在var列表中。

Solved deleting fullscreen: true,layout:'fit' in var list.

这篇关于sencha没有在面板中看到列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆