PDA

View Full Version : GXT BoxComponent and autoEl



b_basham
20 Dec 2010, 5:52 AM
Hello,

I have used ExtJS v2.x for well over a year. I am on a new contract that has chosen GXT v2.x. I am in the process of converting a GUI prototype (in ExtJS v2) into GXT code. I have hit a snag because the prototype has a component that build a custom frame with 'hbox' layouts to place <img> tags (left corner, edge, right corner) across the top and bottom of the frame. Here is a chunk of that code:


,items:[{
xtype:'box'
,width:19
,autoEl:{
tag:'img'
,src:'resources/images/workspace-tl.png'
}
},{
xtype:'box'
,flex:1
,autoEl:{
tag:'img'
,src:'resources/images/workspace-tm.png'
}
},{
xtype:'box'
,width:18
,autoEl:{
tag:'img'
,src:'resources/images/workspace-tr.png'
}
}]

I have tried using the Html and HtmlContainer widgets to hold these <img> tags but it always seems to wrap the contents in <div> tags which defeats the use of the HBoxLayout from injecting the necessary width attributes onto the <img> tags.

And oldly the PngImage class is not a Component so I cannot add images directly to the container.

I have tried to find any reference to the 'autoEl' feature in ExtJS within GXT but have come up empty.

I have even tried to use a Render listener to set the width of the <img> tag and that still doesn't do the trick.

What would you recommend I try next?

Thanks,
Bryan

sven
20 Dec 2010, 4:22 PM
Why cannot you use the Image widget from GWT?