Results 1 to 5 of 5

Thread: How to use Ext.device.Browser listeners

  1. #1
    Sencha User
    Join Date
    Oct 2013
    Location
    New York
    Posts
    1
    Vote Rating
    0
      0  

    Default How to use Ext.device.Browser listeners

    How can I bind the listeners to the InAppBrowser (Cordova plugin)?
    Code:
           
    Ext.device.Browser.open({
    url: uri,
    listeners: {
    'loadstart': function(event){console.log(event.url);},
    'close': function(event){console.log("Exit");}
    },
    options: 'location=no'
    });
    Can anyone give me some examples on how to use the listeners option?
    Thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,327
    Vote Rating
    1297
      0  

    Default

    Ext.device.Browser doesn't have events, the Ext.device.browser.Window does which is cached on the _window property.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2013
    Location
    Manchester
    Posts
    6
    Vote Rating
    0
      0  

    Default

    how to use Ext.device.Browser ,when i want to open a url,firebug show Uncaught TypeError: Cannot read property 'Browser' of undefined

  4. #4
    Touch Premium Member
    Join Date
    Sep 2011
    Posts
    36
    Vote Rating
    0
      0  

    Default

    Have you tried adding the followings?
    Code:
        requires: [
        'Ext.device.Browser',
        'Ext.device.browser.Window'
        ],
    Mine doesn't complain about 'Browser' of undefined, but it just doesn't do anything on my android device. On my desktop, Ext.device.Browser.open("http://www.yahoo.com") just opened an untitled blank webpage.

  5. #5
    Sencha User
    Join Date
    Sep 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Is there any update how to use of these listeners? I did the following code, but the listeners don't work...




    Ext.device.Browser.open({
    url: 'http://www.google.com.br',
    listeners: {
    'loadstart': function(event) {alert('loadstart');},
    'loadstop': function(event) {alert('loadstop');},
    'loaderror': function(event) {alert('loaderror');},
    'close': function(event) {alert('close');}
    },
    showToolbar: false,
    target: '_blank',
    options: 'location=no,hardwareback=no'
    });

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
  •