Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Change Template in List? (v2.1)

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-3677 in a recent build.
  1. #11
    Sencha - Ext JS Dev Team vitalyx's Avatar
    Join Date
    Jul 2012
    Posts
    39
    Vote Rating
    10
      0  

    Default

    Quote Originally Posted by mitchellsimoens View Post
    There is no public dates but patch releases do come out frequently
    Available to support subscribers only?

  2. #12
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Vote Rating
    1297
      0  

    Default

    Quote Originally Posted by vitalyx View Post
    Available to support subscribers only?
    I'm not part of the decision what releases get to be public or are support subscriber only. Support subscribers do get nightly builds though.
    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
    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.

  3. #13
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    2
      0  

    Default

    The records on screen are being rendered improperly and the ones off the screen are being rendered correctly ( try resizing your browser window and you'll see some that are working ).

  4. #14
    Sencha Premium Member alexfluger's Avatar
    Join Date
    Jul 2011
    Location
    Lublin, Poland
    Posts
    6
    Vote Rating
    2
      0  

    Default

    It seems that list item's tpl property set only when sencha creates this item. And it didn't updated when we call refresh method.

    I can suggest two solutions:

    1 - Use dataview instead a list (it can be styled to look like a list)
    2 - Use this fix:

    Code:
    Ext.override(Ext.dataview.List, {
        updateListItem: function(item, index, info) {
            var record = info.store.getAt(index);
            if (this.isSelected(record)) {
                item.addCls(info.selectedCls);
            }
            else {
                item.removeCls(info.selectedCls);
            }
    
    
            item.setTpl(this.getItemTpl());
            item.removeCls([info.headerCls, info.footerCls, info.firstCls, info.lastCls]);
            this.replaceItemContent(item, index, info)
    
    
        }
    });

  5. #15
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    2
      0  

    Default

    Thanks for the fix! I hadn't looked at that #setTpl method.

    I actually ended up creating new lists for each time I would normally just call #setItemTpl. Horrible, I know, but something had to happen yesterday.

  6. #16
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    11
      1  

    Default

    Try the following override:

    Code:
    Ext.define('ListItemTplFix',  {
       override: 'Ext.dataview.List',
    
       updateItemTpl: function(newTpl, oldTpl) {
            var listItems = this.listItems,
                ln = listItems.length || 0,
                i, listItem;
    
            for (i = 0; i < ln; i++) {
                listItem = listItems[i];
                listItem.setTpl(newTpl);
            }
            this.doRefresh();
        }
    });

  7. #17
    Sencha User
    Join Date
    Feb 2012
    Posts
    22
    Vote Rating
    4
      0  

    Default

    Thanks Tommy, the fix works great for me.

    Alex's workaround was working for me as well.

  8. #18
    Sencha User
    Join Date
    Jul 2012
    Posts
    22
    Vote Rating
    2
      0  

    Default

    @TommyMaintz thanks nice fix until Sencha figures it out.

  9. #19
    Sencha User
    Join Date
    Nov 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default Thanks

    Thanks a lot for that.

  10. #20
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Thanks so much for the fixes above and the bug report!

    While migrating an application from Sencha Touch 1.1, I was getting nowhere searching about this problem until I realized it worked in 2.0 but not 2.1.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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