1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Hong Kong
    Posts
    44
    Vote Rating
    0
    Answers
    6
    Winnie Lam is on a distinguished road

      0  

    Post Answered: How to group the list

    Answered: How to group the list


    In the Kitchen Sink example, list can be grouped by using the "grouped" attribute but in the API, "grouped" is not available for Ext.dataview.List. How to group the list?

    Code:
    Ext.define('App.store.ShopInfos', {
        extend: 'Ext.data.Store',
        requires: 'App.model.ShopInfo',
        model: 'App.model.ShopInfo',
        autoLoad: true,
        sorters: 'NameEn',
        groupField: 'category',
        proxy: {
            type: 'ajax',
            url: 'WebService.asmx/GetShopInfo',
            extraParams: {
                Id: 0
            },
            headers: {'Content-type': 'application/json'},
            method: 'post',
            reader: { 
                root: 'd'
            }
        },
        getGroupString: function (record) {
            return record.get('Category')[0];
        }
    
    
    });
    Code:
    { 
                    xtype: 'list', 
                    id: 'shopinfoList',
                    store: 'ShopInfos',
                    onItemDisclosure: function (record) {
                    },
                    itemTpl:    '<div class="list-item-title">{NameEn}</div>' +
                                '<div class="list-item-narrative">{Category}</div>'
                    //grouped: true
                    //indexBar: true
                }

  2. There is an example that comes with the download... in the examples/list/index.html

    grouped and indexbar are valid configs... documentation isn't 100%

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There is an example that comes with the download... in the examples/list/index.html

    grouped and indexbar are valid configs... documentation isn't 100%
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    Hong Kong
    Posts
    44
    Vote Rating
    0
    Answers
    6
    Winnie Lam is on a distinguished road

      0  

    Default


    But I can't use it in this way...

    Code:
    {                 xtype: 'list', 
                    id: 'shopinfoList',
                    store: 'ShopInfos',
                    mode: 'SINGLE',
                    allowDeselect: true,
                    disclosure: true,
                    grouped: true,
                    indexBar: true,
                    itemTpl:    '<div class="list-item-title">{Name}</div>' +
                                '<div class="list-item-narrative">{Category}</div>'
                    //grouped: true
                    //indexBar: true
                }

Thread Participants: 1

Tags for this Thread