Results 1 to 6 of 6

Thread: Handling deviceready in controller

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    425
    Answers
    2

    Default Answered: Handling deviceready in controller

    Hi,
    When I need to use a cordova plugin, I listen for the deviceready event.
    In all examples I have seen so far, the event and its handler are registered in app.js' launch function.
    Is there a way to put the handler in a controller so that I can use the plugin from the controller?
    Basically I want my controller to be notified/launch function called when the deviceready event fires.

    Please help.

  2. This is correct. We detect if you are within a Cordova/PhoneGap app and then add a deviceready listener. The application's launch method (and therefore the controllers' launch methods) will not execute until the deviceready event has already been fired.

Similar Threads

  1. MVC: handling link clicks in the controller
    By a_arias in forum Ext: Discussion
    Replies: 6
    Last Post: 21 May 2013, 2:39 AM
  2. Controller -- sub-classing and event handling.
    By santosh.kumar in forum Ext: Q&A
    Replies: 2
    Last Post: 19 Feb 2013, 11:41 AM
  3. Problem with handling events in controller.
    By zozo4kin in forum Sencha Touch 2.x: Q&A
    Replies: 7
    Last Post: 14 May 2012, 6:32 AM
  4. Controller handling in sencha 2 ?
    By fenderico in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 9 Mar 2012, 8:38 AM

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
  •