Results 1 to 3 of 3

Thread: How to group the list

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Hong Kong
    Posts
    44
    Answers
    6
    Vote Rating
    0
      0  

    Post 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%

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •