Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    23
    Vote Rating
    0
    bwg is on a distinguished road

      0  

    Default [OPEN-771] List groupTpl does not account for spaces in id

    [OPEN-771] List groupTpl does not account for spaces in id


    Here's a patch

    PHP Code:
    Ext.override(Ext.List, {
        
    groupTpl : [
            
    '<tpl for=".">',
                
    '<div class="x-list-group x-group-{[values.id.replace(" ", "-")]}">',
                    
    '<h3 class="x-list-header">{group}</h3>',
                    
    '<div class="x-list-group-items">',
                        
    '{items}',
                    
    '</div>',
                
    '</div>',
            
    '</tpl>'
        
    ]
    }); 

  2. #2
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    I've ran into this, as well. But I'd suggest a slight modification to avoid other potential problems:

    Code:
    Ext.override(Ext.List, {
        groupTpl : [
            '<tpl for=".">',
                '<div class="x-list-group x-group-{[values.id.replace(/\\W/g, \"-\")]}">',
                    '<h3 class="x-list-header">{group}</h3>',
                    '<div class="x-list-group-items">',
                        '{items}',
                    '</div>',
                '</div>',
            '</tpl>'
        ]
    });
    This scrubs any \W char to avoid various other ones that could cause problems with the html.

  3. #3
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    Ugh. I can't actually get the above to work. No matter how many things I've tried to get the regexp in there to function, it just doesn't. I've even tried it with

    Code:
    new RegExp(\"\\W\", \"g\")
    and that bombed, too. Something about how the XTemplate code reads in that function is getting in the way and I can't figure out how to make it like it. You can do it as a user function

    Code:
    var rateGroupTpl = new Ext.XTemplate(
            '<tpl for=".">',
                '<div class="x-list-group x-group-{[this.makeId(values.id)]}">',
                    '<h3 class="x-list-header">{group}</h3>',
                    '<div class="x-list-group-items">',
                        '{items}',
                    '</div>',
                '</div>',
            '</tpl>',
      {
        makeId:function (id) {
          return id.replace(/\W/g, "-");
        }
      }
    );
    Unfortunately, List doesn't really like having XTemplate instances for the groupTpl property, though. I have a fix for that here, though. Maybe both fixes together could make it into a future version.

Similar Threads

  1. List IndexBar does not account for docked items
    By senchauser2010 in forum Sencha Touch 1.x: Discussion
    Replies: 6
    Last Post: 6 Dec 2010, 5:47 PM
  2. Replies: 0
    Last Post: 3 Dec 2010, 7:06 AM
  3. [OPEN-327] List with carousel
    By gmanraj in forum Sencha Touch 1.x: Bugs
    Replies: 8
    Last Post: 29 Nov 2010, 8:22 PM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar