psenough
23 Apr 2011, 7:41 AM
not sure if it's a bug in sencha, in webkit renderer or in me. but i'm trying to do this:
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
var container = new Ext.Container({
items: [
{
html: '<img src="phone_startup.png" />',
listeners: {
click: {
element: 'body',
fn: function(){
alert('image click');
}
}
}
},
{
html: '<h1>First</h1><h2>Last</h2>',
}
],
});
var tabpanel = new Ext.TabPanel({
fullscreen: true,
items: container
});
}
});
seems pretty straight forward, but the text from the second item ends up on top of the image from the first item. if i do a page refresh the renderer renders it properly. its only on first load that it renders it wrong. my guess is the image dimensions arent being accounted for in the first pass. and i can't seem to find any function to refresh the container alone.
i separated it into 2 items to be able to have mouseclick event on the image only, so i can't merge it into 1 item only.
anyone has any clue on whats going on or how to bypass this issue?
maybe a listener that can be attached to onclick of an html tag id or class? instead of just el and body? i failed to find proper documentation on this. /:)
thanks in advance for any hints or help
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
var container = new Ext.Container({
items: [
{
html: '<img src="phone_startup.png" />',
listeners: {
click: {
element: 'body',
fn: function(){
alert('image click');
}
}
}
},
{
html: '<h1>First</h1><h2>Last</h2>',
}
],
});
var tabpanel = new Ext.TabPanel({
fullscreen: true,
items: container
});
}
});
seems pretty straight forward, but the text from the second item ends up on top of the image from the first item. if i do a page refresh the renderer renders it properly. its only on first load that it renders it wrong. my guess is the image dimensions arent being accounted for in the first pass. and i can't seem to find any function to refresh the container alone.
i separated it into 2 items to be able to have mouseclick event on the image only, so i can't merge it into 1 item only.
anyone has any clue on whats going on or how to bypass this issue?
maybe a listener that can be attached to onclick of an html tag id or class? instead of just el and body? i failed to find proper documentation on this. /:)
thanks in advance for any hints or help