I am exactly looking for this. I am using extjs5 , so the updated code i tried is this.
Ext.Function.interceptAfter(Ext.tree.Panel.prototype, 'render', function(treenode) { $('.x-tree-node-icon').removeClass('x-tree-node-icon').replaceWith(function() { if (typeof($(this).attr('class')) != 'undefined') return '<i class="' + $(this).attr('class') + '"/>'; else $(this).addClass('.x-tree-node-icon'); }); });
Ext.Function.interceptAfter(Ext.tree.Panel.prototype, 'setIconCls', function(cls) { $($(this)[0].ui.elNode).find('i').removeClass().addClass(cls); });
======================
I have included this piece of code in Application.js init() funtion.
I am unable to get this working. when i inspect the element, i dont see the dom elements being changed. could you please explain how i can use this with extjs 5 ?
I am exactly looking for this. I am using extjs5 , so the updated code i tried is this.
Ext.Function.interceptAfter(Ext.tree.Panel.prototype, 'render', function(treenode) {
$('.x-tree-node-icon').removeClass('x-tree-node-icon').replaceWith(function() {
if (typeof($(this).attr('class')) != 'undefined')
return '<i class="' + $(this).attr('class') + '"/>';
else
$(this).addClass('.x-tree-node-icon');
});
});
======================
I have included this piece of code in Application.js init() funtion.
I am unable to get this working. when i inspect the element, i dont see the dom elements being changed.
could you please explain how i can use this with extjs 5 ?