Pages

Saturday, October 23, 2010

Internet Explorer - Bug when putting an image in a Toolbar

Hi!

When I put an image in a toolbar, with Internet Explorer 8 and ExtJS 3.3.0, I have the  following error:
Unknown runtime error

My code was

 topMenuToolbar.add({
     html: 'title'
 }); 

I discover that we cannot put an image in a toolbar. To resolve this issue, we must put the image in a box component. So, if you want to put an image in a toolbar component, you must enter the following code:

topMenuToolbar.add({
      xtype: 'box',
      autoEl: {tag: 'img', src:'../images/cie/logo-cie.jpg', alt:"TITLE"}
});

Vive Internet Explorer!!!

3 comments:

  1. Hi!

    I found your post, because I had a similar "Unknown runtime error" in Internet Explorer 8 (row 6657 in ext-all-debug.js). Our Problem was also in a toolbar, not the image problem you had, but we use:

    items: [{
    html: 'my Text',
    },
    { .... }]

    and IE couldn't make the 'html' out. So when we deleted this it worked again. :)

    Thanks for your post.

    //Ola

    ReplyDelete
  2. thanks. I had a boxcomponent defining both a html and a autoEl property, which is wrong. But that caused the problem for me. I removed the html property. (But leaving the html property and removing the autoEl property would have worked as well probably. Just not have them both)

    ReplyDelete