1

如何显示动态嵌套的所有项目Ext.ListEx.Panel这意味着嵌套的高度Ext.List必须是动态的,以及如何为父级添加滚动条,即Ex.Panel

谢谢!

Ext.define('framework.view.ShoppingCart', {
extend: 'Ext.Panel',
alias : 'widget.ShoppingCart',
id: 'ShoppingCart',
requires: [           
       ],
config: {
    autoDestroy: true,
    fullscreen : true,

    items: [
            {
                xtype: 'fieldset',
                id: 'shoppingCartItemsTitle',
                title: Util.getMessageInner('mstore_item_list',null,0),
                height : 27,
                border: 0,
                margin: "10 10 6 10",
                cls: 'items_hided'
            },
            { 
                xtype : 'list',
                itemId : 'itemList2',
                id: 'itemList2',
                autoDestroy: true,
                selectedCls: 'x-item',
                scrollable: 'vertical',
                height : '100%',
                itemTpl: new Ext.XTemplate(
                    '<div class="as_icon_list as_icon_list_bg height_68">',
                        ' <div style="margin:7px 0 0 10px; float:left">',
                            '<div style="display:block;">{gName}</div>',
                            '<div style="display:block;">',
                                ASVari.appInfo.currencyName + '&nbsp;{[Util.formatMoney(values.gPrice)]}&nbsp;&nbsp;&times;&nbsp;&nbsp;',
                                '{gQuantity}',
                            '</div>',
                        '</div>',
                    '</div>'
                )
             }
    ]

}
});
4

1 回答 1

0

I am not sure what it is that you are trying to accomplish...

As far as dynamically setting the data dynamically, you can use the getData() and setData(), getHeight() and setHeight() method for Ext.Panel() and Ext.data.List().

Based on some event you can listen for in a controller you could get all the properties from one view and set them into another view.

For 'how to add a scrollbar for parent, that is Ex.Panel?' I'm really unsure about what you are asking but I think you are looking for something like a scrollable container with items next to a static container that contains a details view.

If that is the case check out the hbox layout. You would do something drop a list with flex : 1 next to a container with details and flex : 5 (or whatever). You would then listen for itemTap on the list and load the container view with the desired data.

Sorry that this was brief but with such a vague question I didn't want to spend the time answering a question you weren't asking.

Please let me know how I might get you some better information.

Good Luck,

Brad

于 2013-07-03T00:30:32.373 回答