1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    103
    Vote Rating
    9
    pepperseb is on a distinguished road

      0  

    Default Best way to design a shopping cart (with multiple components)

    Best way to design a shopping cart (with multiple components)


    Hello,

    I searched over the forum but couldn't find what I'm looking for.

    I would like to create a shopping cart with two blocks (see the attached file):
    1. A list of products with
      1. Some information (thumbnail, name, ..) about the product on the left
      2. A selectfield, under the product name, to select a quantity
      3. More information about the product on the right (prices, ...)
      4. A delete icon, to remove the product from the list
    2. A recap with total price and shipping cost
    My question is that I don't know how to start/organize my view, I mean, which components I should use. Dataview? Iterate through the product store to create a container with selectfield, button, ... ?

    Any help would be greatly appreciated.

    sencha.PNG

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,684
    Vote Rating
    435
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    I would use a Container with a dataview and a container as it's items and each item has a height of 50%.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    103
    Vote Rating
    9
    pepperseb is on a distinguished road

      0  

    Default


    Do I have to set a flex value for both container?

    I would like to stretch the products list depending on how many products are displayed. Thus the second container would be automatically placed below my list.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    103
    Vote Rating
    9
    pepperseb is on a distinguished road

      0  

    Default


    I solved it thanks to this thread: http://www.sencha.com/forum/showthre...st-in-fieldset

    Code:
    Ext.define('App.view.order.basket.Main', {    
    extend: 'Ext.Container',
        xtype: 'basket',
        
        requires: [
            'SF.view.order.basket.Articles',
            'SF.view.order.basket.Summary'
        ],
        
        config: {
            layout: 'vbox',
            
            items: [
                {
                    xtype: 'basket-articleslist',
                    scrollable: false
                },
                {
                    xtype: 'basket-summary'                
                }
            ]
        } 
    });
    Scrollable did the trick.

    Hope this helps