Threaded View
-
9 Jun 2011 1:28 PM #1
List.groupTpl cannot accept an XTemplate
List.groupTpl cannot accept an XTemplate
This could be considered a feature request, as List.groupTpl doesn't show up in the documents so it's hard to say what it's "supposed" to do. However, I've seen it given out by Sencha staff as part of answers, and it isn't marked private in the source code, so I think perhaps you mean for us to use it.
In any case, the way List.initComponent works, groupTpl can't receive an XTemplate instance, so this means it can't have user functions. This is due to this piece of code in List.initComponent:
This strips it of any user functions. Instead, the following could be used:Code:if (Ext.isString(this.groupTpl) || Ext.isArray(this.groupTpl)) { this.tpl = new Ext.XTemplate(this.groupTpl); }
In the meantime, here's the override I'm using as a workaround:Code:if (Ext.isString(this.groupTpl) || Ext.isArray(this.groupTpl)) { this.tpl = new Ext.XTemplate(this.groupTpl); } else if (this.groupTpl && this.groupTpl.html) this.tpl = new Ext.XTemplate(this.groupTpl.html, this.groupTpl.initialConfig);
Code:Ext.jep.List = Ext.extend(Ext.List, { initComponent : function() { Ext.jep.List.superclass.initComponent.apply(this); if (this.grouped && this.groupTpl && this.groupTpl.html) { this.tpl = new Ext.XTemplate(this.groupTpl.html, this.groupTpl.initialConfig); } } });
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote