PDA

View Full Version : Button icon don't accept a constant



timenam
4 Jun 2010, 6:30 AM
Designer version tested: xds-1.0.1.0c
Operating System: Windows Xp
Description: when i create a standard button i can apply an icon (iconCls). If in the icon field of the button i have to put a constant that define a path i can't because the designer set: ' constant '.

Code:


{
xtype: 'button',
text: 'Chiudi',
x: 275,
y: 50,
width: 95,
cls: 'x-btn-text-icon',
iconCls: 'CONST',
ref: 'buttonChiudi'
}


The result that was expected:


{
xtype: 'button',
text: 'Chiudi',
x: 275,
y: 50,
width: 95,
cls: 'x-btn-text-icon',
iconCls: CONST,
ref: 'buttonChiudi'
}


Screenshot:
http://img143.imageshack.us/img143/96/imgerror.jpg

jarrednicholls
4 Jun 2010, 10:16 AM
This isn't a bug and is by design. You can set your constant in your implementation class (the .js file), as opposed to configuring it in your UI class (the .ui.js file). So after you export your project, edit the .js file and configure your iconCls that way.

For example:


MyButton = Ext.extend(MyButtonUi, {
initComponent: function(){
this.iconCls = CONST;

MyButton.superclass.initComponent.call(this);
}
});


With that said, there has been a feature requested to import and manage icon image files and connect them to a constant, much like you describe. We're considering this in a future release.

timenam
8 Jun 2010, 11:13 PM
Ok, thank you!