Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
    jamatz is on a distinguished road

      0  

    Default Grouped Lists with One Item blow up.

    Grouped Lists with One Item blow up.


    REQUIRED INFORMATION
    Ext version tested:
    • Sencha-touch 2.0.0.PR3
    Browser versions tested against:
    • Chrome 16.0.912.75 m
    • Safari 5.1.2
    DOCTYPE tested against:
    • js
    Description:
    • When attempting to create a grouped list with only 1 item in it, sencha throws an error.
    Steps to reproduce the problem:
    • Create a list, with grouped: true (see code snippet below) that has only 1 item.
    The result that was expected:
    • The list should show up.
    The result that occurs instead:
    • Error is thrown: TypeError: Cannot call method 'addCls' of null
    Test Case:
    Code:
    Ext.define('Contact', {   extend: 'Ext.data.Model',
       fields: ['firstName', 'lastName']
    });
    
    
    var store = Ext.create('Ext.data.Store', {
       model: 'Contact',
       sorters: 'lastName',
    
    
       getGroupString: function(record) {
           return record.get('lastName')[0];
       },
    
    
       data: [
          {firstName: 'Jason',   lastName: 'Johnston'}
       ]
    });
    
    
    var list = Ext.create('Ext.List', {
       fullscreen: true,
        grouped: true,
       itemTpl: '<div class="contact">{firstName} <strong>{lastName}</strong></div>',
       store: store
    });
    HELPFUL INFORMATION
    Operating System:
    • Windows 7 Profressional

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Known issue that is fixed for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins

Thread Participants: 1

Tags for this Thread