View Full Version : Need panel.setIconUrl... HowTo?

10 Jul 2010, 6:25 AM
How can i set the panels icon url on runtime? I try

setIconURL : function(url){
console.log(this.header, "url('" + url + "') no-repeat center left !important;");
this.header.setStyle("background", "url('" + url + "') no-repeat center left !important;")

But this won´t work... Why?

10 Jul 2010, 6:39 AM
For a panel with frame:false it's:

panel.setIconClass(' ');
panel.header.child('img.x-panel-inline-icon', true).src = url;

10 Jul 2010, 6:46 AM
.child returns an Ext.Element. Needs ", true"

10 Jul 2010, 11:38 PM
ok, but when i have no img.x-panel-inline-icon i have a problem :-) I play around with the portal sample and the when i set a iconCls on a portlet there is no inline-icon:

MY-ICONCLS is the iconCls definition inside my sample code.

<div class="x-panel-tl">
<div class="x-panel-tr">
<div class="x-panel-tc">
<div class="x-panel-header x-unselectable x-panel-icon MY-ICONCLS" id="ext-gen66" style="-moz-user-select: none; cursor: move;">
<div class="x-tool x-tool-close" id="ext-gen75">&nbsp;</div>

11 Jul 2010, 2:45 AM
Correct, that's a panel with frame:true. You'll have to insert your own img tag in the title.