PDA

View Full Version : IE 8 Msg problem



madirishman
16 Aug 2009, 6:03 AM
Hi, I tried searching all over, but can't find this particular problem. (and yes, i'm new to extjs). All others browsers look fine.

This is what I see in ie8 when I use a Msg.alert object:

http://www.thedigitalapex.com/temp/capture.jpg


here it is (correctly) in ff:

http://www.thedigitalapex.com/temp/capture2.jpg

here is my code:


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EXTJS Test Area</title>
<link rel="stylesheet" type="text/css" href="/CFIDE/scripts/ext-3.0.0/resources/css/ext-all.css" />
<script src="/CFIDE/scripts/ext-3.0.0/adapter/ext/ext-base.js"></script>
<script src="/CFIDE/scripts/ext-3.0.0/ext-all-debug.js"></script>

<script>
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL='\CFIDE\scripts\ext-3.0.0\resources\images\default\s-gif';

Ext.Msg.show({
title: 'Milton',
msg: 'Have you seen my stapler?',
buttons: {
yes: true,
no: true,
cancel: true
}

});
});
</script>

</head>

<body>

</body>
</html>

What am I missing??

Thanks!
md

andycramb
16 Aug 2009, 1:06 PM
try this
Taken from the API



Ext.Msg.show({
title:'Save Changes?',
msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
buttons: Ext.Msg.YESNOCANCEL,// as specified in the API
fn: processResult,
animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});


Replace the button object with the buttons property

VinylFox
16 Aug 2009, 1:39 PM
Its not a 'property', that's a constant that Ext defines, and it is simply set to the value below, which is what madirishman essentially has:


{"yes":true,"no":true,"cancel":true}

I would start by changing the slashes in your blank image url to the appropriate slashes and did you notice that you have a hyphen in 's.gif' instead of a dot?

ie:

Ext.BLANK_IMAGE_URL='/CFIDE/scripts/ext-3.0.0/resources/images/default/s.gif';

See how that works to start with. I don't see anything else wrong with your code - looks great.

madirishman
16 Aug 2009, 3:38 PM
Thanks for both of the responses. I corrected the image link and that didn't help - but this did: I just added something between the body tags (I put an empty div in there) and presto - success!

It must have been something to do with having nothing in the body of the document.

My confidence is now restored - I'm going to continue learning... this is fun stuff!

Thanks
md

VinylFox
16 Aug 2009, 3:56 PM
Good job, glad you found the problem.

Also, make sure you get the eratta list from the publisher site along with the updated code from the link in my signature.

madirishman
16 Aug 2009, 4:53 PM
Sounds good. Thanks!

p.s. any idea why adding content to the body would make a difference?

VinylFox
16 Aug 2009, 5:55 PM
Its just another one of those funky IE things, im not sure about the technical details why, but many people just add an empty div to the body.

andycramb
17 Aug 2009, 12:35 AM
@VinylFox

So can you pass in a config with your buttons property set to an object like this:


{"ok":true,"cancel":true}for the MessageBox's show method? Could not see this in the API?
The other approach then is to specify a constant such as?
Ext.Msg.YESNOCANCEL

VinylFox
17 Aug 2009, 5:32 AM
So can you pass in a config with your buttons property set to an object like this:

{"ok":true,"cancel":true}for the MessageBox's show method? Could not see this in the API?
The documentation gives an example of this if you expand the 'show' method...


# buttons : Object/Boolean
A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo', cancel:'Bar'}), or false to not show any buttons (defaults to false)


The other approach then is to specify a constant...
Yes, and the constant just contains that same object anyway. The constant is just a shortcut so to speak.

andycramb
17 Aug 2009, 7:28 AM
Nice one. Thanks