PDA

View Full Version : Visibility Problem in 1.1



kitepad
9 Aug 2007, 9:36 PM
Hi,

When I change ext from 1.0 to 1.1, my menu item is hided by PDF file.
My PDF file is showed in a iframe, and this iframe is host in a borderlayout tab.

Pls see attachments. Sorry for some characters are chinese.

mystix
10 Aug 2007, 8:11 AM
iframes do that.

try embedding your pdf in an <object> tag instead of an <iframe>.

kitepad
10 Aug 2007, 7:26 PM
I'm tring use object tag. But, why it's display correctly in 1.0?

kitepad
10 Aug 2007, 11:01 PM
Hi,

I try to use <object> tag to replace <iframe> tag, but problem is not gone. Any suggestions?

Following are my code:


Desktop = function(){
var layout;
var statusPanel;
var mydialog;

return {
init : function(){
layout = new Ext.BorderLayout(document.body, {
north: {
split:false,
//initialSize: 36,
titlebar: false
},
south: {
split:false,
initialSize: 22,
titlebar: false,
collapsible: false,
animate: false
},
center: {
titlebar: false,
autoScroll:false,
tabPosition: 'top',
closeOnTab: true,
alwaysShowTabs: true,
resizeTabs: true
}
});
// tell the layout not to perform layouts until we're done adding everything
layout.beginUpdate();

layout.add('north', new Ext.ContentPanel('header'));
//create menu
this.createMenu();

this.createMain();
// initialize the statusbar
statusPanel = new Ext.ContentPanel('status');
south = layout.getRegion('south');
south.add(statusPanel);
// restore any state information
layout.restoreState();
layout.endUpdate();
statusPanel.getEl().addClass("x-layout-container");
Ext.get('loading').hide();
},

createMain : function(title,url,closable) {
var iframe = layout.getEl().createChild({tag: 'iframe', border:0,frameborder: 0, src: 'main.html'});
var tab =new Ext.ContentPanel(iframe, {title:"Main", autoCreate:false,fitToFrame: true, closable: false});
layout.getRegion('center').add(tab);
},


menuHandler : function(item){
alert(item.text);
},

menuHandler1 : function(item){
var c = layout.getEl().createChild({tag:'div',width:400,height:400});
tab =new Ext.ContentPanel(c, {title:'Clarkson', autoCreate:true,fitToFrame: true, closable: true});
layout.getRegion('center').add(tab);
tab.setContent('<OBJECT CLASSID="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="100%" height="100%"><PARAM NAME="SRC" VALUE="content/pdf/clarkson.pdf"></OBJECT>');
},

menuHandler2 : function(item){
var iframe = layout.getEl().createChild({tag: 'iframe', border:0,frameborder: 0});
iframe.dom.src = 'content/pdf/ssy.pdf';
tab =new Ext.ContentPanel(iframe, {title:'SSY', autoCreate:true,fitToFrame: true, closable: true});
layout.getRegion('center').add(tab);
},

menuHandler3 : function(item){
var iframe = layout.getEl().createChild({tag: 'iframe', border:0,frameborder: 0});
iframe.dom.src = 'content/pdf/fearnleys.pdf';
tab =new Ext.ContentPanel(iframe, {title:'Fearnleys', autoCreate:true,fitToFrame: true, closable: true});
layout.getRegion('center').add(tab);
},
onThemeClick : function(item, checked) {
Ext.util.CSS.swapStyleSheet('theme', 'resources/css/ytheme-' + item.id + '.css');
},

createMenu : function() {
var currentTheme = 'default';

var marketInfoMenu = new Ext.menu.Menu({
id: 'marketInfoMenu',
items: [
{
text: 'BDI',
handler: this.menuHandler,
scope: this
},
{
text: 'BDC',
handler: this.menuHandler,//this.onMarkFeedsRead,
scope: this
},
{
text: 'ABF',
handler: this.menuHandler, //this.onImportOPML,
scope: this
},
{
text: 'AGD',
handler: this.menuHandler,//this.onExportOPML,
scope: this
},
{
text: 'AAA',
handler: this.menuHandler //this.onEmptyTrashClick
},
{
text: 'BBB',
handler: this.menuHandler //this.onEmptyCache.createDelegate(this)
},
{
text: 'CCC',
handler: this.menuHandler //this.onEmptyCache.createDelegate(this)
},
{
text: 'DDD',
handler: this.menuHandler //this.onEmptyCache.createDelegate(this)
},
{
text: 'EEEE',
handler: this.menuHandler //this.onEmptyCache.createDelegate(this)
},
{
text: 'FFFF',
handler: this.menuHandler //this.onEmptyCache.createDelegate(this)
},
{
text: 'KKKKK',
handler: this.menuHandler //this.onEmptyCache.createDelegate(this)
}
]
});

var monthReportMenu = new Ext.menu.Menu({
id: 'monthReportMenu',
items: [
{
text: 'Clarkson',
handler: this.menuHandler1
},
{
text: 'SSY',
handler: this.menuHandler2
},
{
text: 'Fearnleys',
handler: this.menuHandler3
},
{
text: 'Cosbulk',
handler: this.menuHandler
}]
});

var evaluateFareMenu = new Ext.menu.Menu(
{
id: 'evaluateFareMenu',
items: [
{
text: 'Test 1',
handler: this.menuHandler //this.onHelpClick
},
{
text: 'Plan 2',
handler: this.menuHandler //this.onStatsClick
},
{
text: 'Report 2',
handler: this.menuHandler //this.onAboutClick
},
{
text: 'Report 3',
handler: this.menuHandler //this.onAboutClick
},
{
text: 'Table 4',
handler: this.menuHandler //this.onAboutClick
},
{
text: 'Plan A',
handler: this.menuHandler //this.onAboutClick
},
{
text: 'COA Report',
handler: this.menuHandler //this.onAboutClick
},
{
text: 'Sample X',
handler: this.menuHandler //this.onAboutClick
},
{
text: 'Rate 2',
handler: this.menuHandler //this.onAboutClick
}]
});


menutb = new Ext.Toolbar('menu-tb');
menutb.add({
cls: 'x-btn-text-icon bmenu', // icon and text class
text:'Menu A',
menu: marketInfoMenu // assign menu by instance
},'-',
{
cls: 'x-btn-text-icon bmenu', // icon and text class
text: 'Menu B',
menu: monthReportMenu
},'-',
{
cls: 'x-btn-text-icon bmenu', // icon and text class
text: 'Menu C',
menu: evaluateFareMenu
}
);
}
};
}();
Ext.onReady(Desktop.init, Desktop);

mystix
10 Aug 2007, 11:14 PM
firstly, i think the correct format for the <object> tag is


<object id="mypdf" data="/path/to/my/pdf/doc.pdf" type="application/pdf" title="My PDF" width="100%" height="100%"></object>


secondly, try setting the z-index of this <object> tag to a value which is lower than the menu's z-index. IIRC, the default value of the menu's z-index was changed between 1.0 and 1.1.

kitepad
10 Aug 2007, 11:51 PM
Hi,

Thanks. It's my fault, because I mixed use 1.1 js file and 1.0 css file together, so I cann't get correct z-index.

It's solved, very thanks.

kitepad
11 Aug 2007, 12:10 AM
Hi,

When I use 1.1 resources (css/images/etc) with 1.1 .js file, menu can show above on pdf file, but have a strange problem: menu list's left border is show above, but right border and bottom border CAN NOT show above on PDF.

mystix
11 Aug 2007, 7:02 AM
post a screenshot

kitepad
11 Aug 2007, 7:41 AM
Pls see screen shot:

kitepad
13 Aug 2007, 9:48 PM
No solutions?

jay@moduscreate.com
14 Aug 2007, 7:58 AM
it has to do with absolute Z ordering of objects. PDFs, Flash, etc 99.99% of the time win over any other html object. i have the exact same issue with flash. just can't fix it.

http://content.screencast.com/?parameters=c264daec-c17c-498f-b165-2864bbab20d2_761d6d1b-52dd-469b-a7dc-543cd0878ea3_static_0_0_image.png

kitepad
14 Aug 2007, 8:17 AM
We have fixed this problem for FLASH by adjust z-index,but this approach don't have effect with PDF.

jay@moduscreate.com
14 Aug 2007, 10:26 AM
and it works both the same in IE 6, 7 and FF?

kitepad
14 Aug 2007, 10:19 PM
Sorry, we are not adjust z-index.
Because we are only support IE 5.5+, and flash player have a parameter: wmode=transparent can be used to show menu above
on flash.

Pls check flash parameters document for more details.

jay@moduscreate.com
15 Aug 2007, 2:34 AM
Interesting, i did set the wmode=transparent for the embed object.


sorry for the thread hijack. :)

kitepad
17 Aug 2007, 1:34 AM
Is it a bug or not?