Hybrid View

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1176 in a recent build.
  1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    Toronto
    Posts
    105
    Vote Rating
    2
    basememara is on a distinguished road

      0  

    Default prepareData not working in List?

    prepareData not working in List?


    Both variables show up blank in the template. In regular Ext JS 4, this works perfectly. Is there a new way to do this in Touch 2 or is this a bug?

    Code:
    {    xtype: 'list',
        store: 'SomeStore',
        itemTpl: [
            '<div>{shortTitle}</div>',        '<div>{sometest}</div>'
        ],
        prepareData: function(data) {
            Ext.apply(data, {
                shortTitle: Ext.util.Format.ellipsis(data.name, 7),            sometest: 'Test'
            });
            return data;
        }
    }

  2. #2
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    This is a bug. I've added it to our bug tracker.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    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


    This has been fixed for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins

  4. #4
    Sencha User chuckoh's Avatar
    Join Date
    Jan 2012
    Location
    Seoul, Korea
    Posts
    16
    Vote Rating
    0
    chuckoh is on a distinguished road

      0  

    Default just wondering...

    just wondering...


    when do you think you guys'll release the prepareData bug fixed version? any rough ideas?

  5. #5
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    20
    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


    I can't give any dates as of yet, should be soon though.

    Sencha Inc

    Jamie Avins

    @jamieavins

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2011
    Posts
    29
    Vote Rating
    1
    neilios is on a distinguished road

      0  

    Default Is this really fixed?

    Is this really fixed?


    I'm using version 2.0.1.1 and am running into this problem using an Ext.dataview.List instance, where prepareData is not being called at all.

    Is the fix in some other version or have I found something else?

    Code:
    var cfg = {
        extend:'Ext.dataview.List';
        config: {
           store: myStore;
            itemTpl: [
                  '<tpl for=".">',
                      '<div class="requests-wrap x-data-item" id="request-{ID}">',
                          '{title}',
                          '<span>{summary}</span>',
                          '<span>{subject}</span>',
                      '</div>',
                  '</tpl>',
                  '<div class="x-clear"></div>'
            ].join(''),
    
            prepareData: function(data, recordIndex, record) {
                // Never called
                Ext.apply(data, {
                    title: "My Title,
                    summary: "My Summary"
                });
                return data;
            },        
        }
    }
    Ext.define('myName', cfg);

    Thanks,
    Neil