PDA

View Full Version : Ext.widget set iconCls problem



nurhadijogja
31 Oct 2012, 2:26 AM
Hi all,
I have a widget named 'mywidget'. When I call this widget and want to change the title property using Ext.widget, it works fine. but when I want to change iconCls property, it can't work. can anyone tell me why did it happen?

My code:

Ext.widget('mywidget', {
title: "new title"
});
work fine..


Ext.widget('mywidget', {
iconCls: "someicon"
});
not working.. the 'someicon' class not applied and icon not shown

James Goddard
31 Oct 2012, 3:49 AM
What is the base class of your widget?

nurhadijogja
31 Oct 2012, 5:33 PM
Ext.Window:

Ext.define('Apm.view.accexe.Form', {
extend: 'Ext.Window',
alias: 'widget.mywidget',
constrain: true,
autoShow: true,
width: 500,
height: 250,
html: 'MyWidget Test'
});

James Goddard
31 Oct 2012, 5:39 PM
Are you setting both the title and iconCls? I don't see either in your example. The iconCls is applied to the header element, which you won't have without a title.

nurhadijogja
31 Oct 2012, 7:27 PM
Oh,, I'm sorry. I have something stupid in my code.
And now, everything works properly.. I have a form. with this form I will add or edit user accounts. In the browser I focus on editAccount, but in a text-editor I change addAccount. I'm very very stupid .. :(