0

我正在尝试遵循 Sencha 给出的列表水平示例。我收到一条消息说(DataView 的基本布局必须始终是适合布局)在示例中它不是适合布局。有人可以告诉我我在这里缺少什么。谢谢吉姆

  Ext.define( 'Styles.view.Beginning', { 
    extend: 'Ext.List',
    xtype: 'beginninglist',

    config: {
     title:'Beginning',
     iconCls: 'star',


 layout:{
     type:'vbox',
     pack: 'center'
 },
   items:[

    {

      //give it an xtype of list for the list component
                xtype: 'dataview',
                height: 250,


                scrollable: 'horizontal',
                directionLock: true,
                inline: {
                    wrap: false
                },


                //set the itemtpl to show the fields for the store
                itemTpl: '{name} {image}',


                //bind the store to this list
                 store: 'Beginning'

    }

     ]

   }
  });
4

1 回答 1

0

首先,您需要学习煎茶布局。你可以参考这里。您正在创建一个List,然后尝试将其放入Dataview其中。因此,如果您需要 Dataview,请直接扩展 Dataview,如下所示:

Ext.define('Styles.view.Beginning', {
        extend: 'Ext.dataview.DataView',
        xtype: 'beginninglist',
        config: {
            inline: {
                wrap: false
            },
            scrollable: {
                direction: 'horizontal'
            },

            //set the itemtpl to show the fields for the store
            itemTpl: '{name} {image}',

            //bind the store to this list
            store: 'Beginning'
        }
    });
于 2014-11-21T13:08:50.830 回答