Results 1 to 3 of 3

Thread: autoEl with a custom component

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore,IN
    Posts
    114
    Answers
    6

    Default Answered: autoEl with a custom component

    Hi,

    I created a iframe custom component with autoEl config as,

    Code:
           autoEl{
             tag:'iframe',
              src='',
          },
          load:function(config){
             var d = this.getEl();
             d.dom.src = 'config.url'+'?action=get_data';
             d.dom.onload = function(){
                 //get the 404 error from server and display some Error.
             }
          }


    My question is that, the 404 is error is caught in FF, chrome. But it is not caught in IE. I read in some stackoverflow sites that, IE doesn't allow adding on load event dynamically. If so, how to catch the 404 error in IE ?

    Thanks,
    g87

  2. Inside the load event of the custom component, I created

    d.dom.onerror = function(){
    //alert();
    }

    But this doesn't come inside the loop.

    I tried catching what browser is & it came inside the loop for IE with,

    Code:
         if(Ext.isIE9 || Ext.isIE8 || Ext.isIE7){
           e.dom.onreadystatechange = function(){
             if(e.dom.readyState == 'complete'){               
                  if(e.dom.attachEvent){
                    e.dom.attachEvent('onload', function(){
                           Ext.Msg.show({
                             title:'File Missing',
                             msg:'Error message goes Here !',
                             buttons:Ext.Msg.OK,
                             icon:Ext.MessageBox.ERROR
                           });
                        
                    });
                  }//attachEvent
             }//readyState
           };//onreadystatechange
         }


    This Worked !

  3. #2
    Sencha Premium Member
    Join Date
    Aug 2011
    Location
    India
    Posts
    37
    Answers
    1

    Default dom.OnError


  4. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore,IN
    Posts
    114
    Answers
    6

    Default

    Inside the load event of the custom component, I created

    d.dom.onerror = function(){
    //alert();
    }

    But this doesn't come inside the loop.

    I tried catching what browser is & it came inside the loop for IE with,

    Code:
         if(Ext.isIE9 || Ext.isIE8 || Ext.isIE7){
           e.dom.onreadystatechange = function(){
             if(e.dom.readyState == 'complete'){               
                  if(e.dom.attachEvent){
                    e.dom.attachEvent('onload', function(){
                           Ext.Msg.show({
                             title:'File Missing',
                             msg:'Error message goes Here !',
                             buttons:Ext.Msg.OK,
                             icon:Ext.MessageBox.ERROR
                           });
                        
                    });
                  }//attachEvent
             }//readyState
           };//onreadystatechange
         }


    This Worked !

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •