Results 1 to 2 of 2

Thread: Multiple redundant headers in Grouped List

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User DrunkenBeard's Avatar
    Join Date
    May 2011
    Vote Rating

    Default Multiple redundant headers in Grouped List

    Hi there,

    First, here's the code I'm using to populate my grouped list :

    Model :
    Ext.define('App.model.User', {
        extend: '',
        fields: ['id', 'name'],
        proxy: {
            type: 'ajax',
            url: 'app/remote/GetData.php',
            reader: {
                type: 'json',
                root: 'users'
    Store :
    Ext.define('', {
        extend: '',
        requires: 'App.model.User',
        model: 'App.model.User',
        sorters: 'name',
        getGroupString : function(record) {
            return record.get('name')[0]
    List :
    Ext.define('App.view.users.List', {
        extend: 'Ext.List',
        xtype: 'userslist',
        config: {
            flex: 1,
            store: 'Users',
            itemTpl: '{name}',
            grouped: true,
            indexBar: true
    List controller where the loading gets done :
    Ext.define('App.controller.Users', {
        extend: '',
        stores: ['Users'],
        init: function() {
                '#reload': {
                    tap: this.loadUsersStore
        loadUsersStore: function() {
            var usersStore = this.getUsersStore();

    If you read the controller code you'll notice that I'm listening to the 'tap' event on a button and then loading the store. When I click on that '#reload' button it does the job indeed, but when I click on it again it creates double headers for my groups, then triple if I click again, and so on ... Here's a picture :

    I investigated the problem and it seems this is the faulty part of the framework :

    findGroupHeaderIndices: function() {
        // Some stuff
        // Add header to an item if needed        
        for (; i < groupLn; i++) {
                firstGroupedRecord = groups[i].children[0];
                index = store.indexOf(firstGroupedRecord);
                // This is always true. For some reason even if firstGroupedRecord does belong to previousHeadersIndices the 'indexOf' method returns -1
                if (previousHeaderIndices.indexOf(firstGroupedRecord) == -1) {
                    me.doAddHeader(items[index], store.getGroupString(firstGroupedRecord));
    Hope it helps

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

Posting Permissions

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