PDA

View Full Version : SOLVED: Help with viewport or other thing, in IE7



dias
28 May 2009, 3:48 AM
Hello,

i have this code



Ext.BLANK_IMAGE_URL = './javascript/extjs3/resources/images/default/s.gif';

Ext.onReady(function(){
var wizardContainer = new Ext.Panel({
id: 'wizardContainer'
,name: 'wizardContainer'
,region:'center'
,margins:'0 0 0 0'
,layout:'border'
,autoScroll:false
,border:false
,width: '100%'
,height: '100%'
,bodyStyle: 'background: none'
,items: [{
region: 'center'
,border: false
,bodyStyle: 'background: none'
}]
});

var viewport = new Ext.Viewport({
layout:'border'
,cls : 'viewport'
,hideMode: 'offsets'
,items:[wizardContainer]
});
}


this css:



.viewport {
background-color: #ffffff;
background-image: url(../images/pints1.png) no-repeat;
}



I use ExtJS3RC1.1, in IE8 and FF3.0.10 works fine.

But in IE7 this error:

"Expected identifier, string or number (http://ldaptest.ipcb.pt/newsite/,147)"

How can i know here is the error... can someone help me...


Thanks in advance

Paulo Dias

conorarmstrong
28 May 2009, 3:57 AM
doubt that it's it but there's an error in the last line of your code (I've put it in red):


Hello,

i have this code



Ext.BLANK_IMAGE_URL = './javascript/extjs3/resources/images/default/s.gif';

Ext.onReady(function(){
var wizardContainer = new Ext.Panel({
id: 'wizardContainer'
,name: 'wizardContainer'
,region:'center'
,margins:'0 0 0 0'
,layout:'border'
,autoScroll:false
,border:false
,width: '100%'
,height: '100%'
,bodyStyle: 'background: none'
,items: [{
region: 'center'
,border: false
,bodyStyle: 'background: none'
}]
});

var viewport = new Ext.Viewport({
layout:'border'
,cls : 'viewport'
,hideMode: 'offsets'
,items:[wizardContainer]
});
});

dias
28 May 2009, 5:20 AM
Ok...

But, what is the error, and how i correct it... :)


Paulo Dias

tryanDLS
28 May 2009, 6:47 AM
Should be obvious if you run your code thru jslint.

Animal
28 May 2009, 6:49 AM
Overnested.

A border layout Panel inside the border layout Viewport!

dias
28 May 2009, 6:54 AM
Ok, but can you explain me how to test the code in jslint!


Thanks

Paulo Dias

conorarmstrong
28 May 2009, 7:02 AM
Both viewport and wizardContainer have border layouts - is that intentional?

Also, the item you have included in wizardContainer doesn't do (display) anything.

Code amended slightly to produce an output below:




Ext.onReady(function(){
var wizardContainer = new Ext.Panel({
id: 'wizardContainer'
,name: 'wizardContainer'
,region:'center'
,margins:'0 0 0 0'
// ,layout:'border'
,autoScroll:false
,border:false
,width: '100%'
,height: '100%'
,bodyStyle: 'background: none'
,html: 'Blah Blah'
/* ,items: [{
region: 'center'
,border: false
,bodyStyle: 'background: none'
}]*/
});

var viewport = new Ext.Viewport({
layout:'border'
,cls : 'viewport'
,hideMode: 'offsets'
,items:[wizardContainer]
});
});

dias
28 May 2009, 7:07 AM
Animal,


Sorry, but what do you mean whit "overnested"...


Thanks,

Paulo Dias

conorarmstrong
28 May 2009, 7:13 AM
overnested - having components inside redundant (usually) panels which could be done away with.

dias
28 May 2009, 7:17 AM
Ok... and thanks for the language lesson.

i try the corrected code,

but in IE7 the same error:

"Expected identifier, string or number (http://ldaptest.ipcb.pt/newsite/,147)"


Thanks

Paulo

conorarmstrong
28 May 2009, 7:21 AM
works fine in mine - v7.0.6001.18000

dias
28 May 2009, 8:11 AM
In 7.0.5730.13... the same error.

conorarmstrong
28 May 2009, 8:18 AM
just to clarify, are you saying the following script errors for you (you'll need to fix the path names for ext):



<html>
<head>
<link rel="stylesheet" type="text/css" href="./lib/ext/resources/css/ext-all.css">
<script type="text/javascript" src="./lib/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="./lib/ext/ext-all-debug.js"></script>
<STYLE TYPE="text/css" MEDIA=screen>
<!--
.viewport {
background-color: #ffffff;
background-image: url(../images/pints1.png) no-repeat;
}
-->
</STYLE>
</head>
<body>
<script>

Ext.BLANK_IMAGE_URL = 'lib/ext/resources/images/default/s.gif';

Ext.onReady(function(){
var wizardContainer = new Ext.Panel({
id: 'wizardContainer'
,name: 'wizardContainer'
,region:'center'
,margins:'0 0 0 0'
// ,layout:'border'
,autoScroll:false
,border:false
,width: '100%'
,height: '100%'
,bodyStyle: 'background: none'
,html: 'Blah Blah'
/* ,items: [{
region: 'center'
,border: false
,bodyStyle: 'background: none'
}]*/
});

var viewport = new Ext.Viewport({
layout:'border'
,cls : 'viewport'
,hideMode: 'offsets'
,items:[wizardContainer]
});
});

</script>
</body>
</html>

dias
29 May 2009, 1:10 AM
I have solved the problem, it is a bug in a plugin i use. The code you post works FINE.

Thanks for your help.


Paulo Dias