Results 1 to 2 of 2

Thread: How do I call a static function?

  1. #1
    Sencha User
    Join Date
    Aug 2014
    Posts
    21

    Default Answered: How do I call a static function?

    I've created a static function from the toolbox and I've moved it to "Application" in the project inspector. I've set "fn", wrote the code and the static function does appear in the inspector.

    However, I don't have the slightest clue how to send it from anywhere in the application.

    I've tried:

    Code:
    Ext.myFunction(); // nope
    Ext.app.myFunction(); // nope
    window.myFunction(); // nope
    
    // and this in the onLaunch function:
    this.myFunction(); // nope again
    this.self.myFunction(); // nope, nope and nope
    I can't find anywhere how to call a static function.

    Please help

  2. Perhaps just my style, but I NEVER put a static function in the application, functions that I call often are either:In a controller (I always have one "system" controller with common functions)in the main (initial view) componentthen you can call them either by MyAppName.getController('System').myfunction()or Ext.ComponentQuery.query('#InitalComponent').getController().myfunction()Sorry, can't help you with calling it in the ApplicationBruce

  3. #2
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Connecticut
    Posts
    1,003
    Answers
    12

    Default

    Perhaps just my style, but I NEVER put a static function in the application, functions that I call often are either:In a controller (I always have one "system" controller with common functions)in the main (initial view) componentthen you can call them either by MyAppName.getController('System').myfunction()or Ext.ComponentQuery.query('#InitalComponent').getController().myfunction()Sorry, can't help you with calling it in the ApplicationBruce

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
  •