-
14 Feb 2011 9:15 PM #1
[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>'
]
});
-
13 Jun 2011 9:38 AM #2
I've ran into this, as well. But I'd suggest a slight modification to avoid other potential problems:
This scrubs any \W char to avoid various other ones that could cause problems with the html.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>' ] });
-
13 Jun 2011 10:04 AM #3
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
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 functionCode:new RegExp(\"\\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.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, "-"); } } );
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
List IndexBar does not account for docked items
By senchauser2010 in forum Sencha Touch 1.x: DiscussionReplies: 6Last Post: 6 Dec 2010, 5:47 PM -
[OPEN-626] 1.0.1 Grouped Ext.List Issue When Adding Items When List Not Visible
By benwhite in forum Sencha Touch 1.x: BugsReplies: 0Last Post: 3 Dec 2010, 7:06 AM -
[OPEN-327] List with carousel
By gmanraj in forum Sencha Touch 1.x: BugsReplies: 8Last Post: 29 Nov 2010, 8:22 PM


Reply With Quote