Sep 04, 2013, 1:48 PM
[CLOSED] Ext.Net Multicombo subclassing and rendering "tpl" for the items.
Hi, I am trying to subclass the MultiCombo control, and since I need to change the item rendering template based on some custom data, I tried to override the "tpl".
However, I've seen that the currently implemented algorithm is somehow broken when a component has a template already in place:
I was going to try overriding the initComponent for the base class, however I would like to check with you if it's the right way to go or not,
Thanks!
However, I've seen that the currently implemented algorithm is somehow broken when a component has a template already in place:
function () {
this.editable = false;
if (!this.tpl) {
this.tpl = '<tpl for="."><div class="x-combo-list-item {[this.getItemClass()]}">' +
'<img src="' + Ext.BLANK_IMAGE_URL + '" class="{[this.getImgClass(values)]}" />' +
'<div class="x-mcombo-text">{' + this.displayField + '}</div></div></tpl>';
this.tpl = new Ext.XTemplate(this.tpl, {
getItemClass : (function () {
if (this.selectionMode === "selection") {
return "x-mcombo-nimg-item";
}
return "x-mcombo-img-item";
}).createDelegate(this),
Let's say I need all the Multicombo functionality but with a different rendering (for instance putting some rows with different colors, putting a separator... and so on...I was going to try overriding the initComponent for the base class, however I would like to check with you if it's the right way to go or not,
Thanks!
Last edited by Daniil; Sep 12, 2013 at 2:59 PM.
Reason: [CLOSED]