PDA

View Full Version : [OPEN] Ext.Panel showBy alignTo offset from showBy component is not configurable



drb
26 Oct 2012, 6:59 AM
Sencha Touch 2.1.0-rc2

Ext.Panel alignTo function uses a fixed (hard-coded) offset of 10 pixels from the showBy component.

Is there any reason that this could not be a config parameter?

I am using Ext.Panel showBy on a List Item. Having the tip 10 pixels from the item suggests that the panel actually refers to the adjacent item.

Actually, if I had such a config parameter, I would probably set it negative so that the pointer was inside the List Item.

If I implement this myself and send back the sources would you consider using this change? And, what is an appropriate name for the offset config parameter?

-David

drb
26 Oct 2012, 7:34 AM
Sencha Touch 2.1.0-rc2

When you use Ext.Panel showBy method it invokes alignTo which runs the Ext.Component alignTo.

However, the Panel then applies an offset of 10 pixels.

This can interfere with the constraint applied by the Ext.Component alignTo and the result is that the Panel ends up 10 pixels off the top of the screen when using "bc-tc?" alignment.

It would be better if the Ext.Component alignTo has an extra parameter of offset which the Ext.Panel could pass it.

Thanks
David

mitchellsimoens
26 Oct 2012, 7:53 AM
Thanks for the report! I have opened a bug in our bug tracker.

drb
26 Oct 2012, 6:20 PM
A workaround is to use CSS - -webkit-transform: translateY(10px); will lower the panel and tip. Similar CSS can be used to raise, shift right or left.