Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript - Sencha touch 2.1 - Calling an app.js level function returns "[object Object] has no method 'getLocalLoggedUserDetails'"
    primarykey
    data
    text
    <p>I have written a simple global function at the <code>app.js</code> level of my sencha touch 2.1 application. Now, based on the clues found here on stack and from other sources, all that i have to do to call it from everywhere is something like</p> <p><code>TimeMobile.app.myGlobalFunction(params);</code></p> <p>the point is, it does not work and i get the error:</p> <blockquote> <p>Uncaught TypeError: Object [object Object] has no method 'getLocalLoggedUserDetails' </p> </blockquote> <p>I tried to call the <code>launch()</code> function instead and that is working. This is puzzling me more than before because at this point it's not a syntax problem.</p> <p>I call the global function like this:</p> <p><code>var LoggedUserDetails = TimeMobile.app.getLoggedUserDetails(true);</code></p> <p>and my app.js is defined like this:</p> <pre><code>Ext.Loader.setConfig({ enabled: true }); Ext.application({ models: [ 'LoginResponse' ], stores: [ 'LoginStore', 'PlannedActivityListStore', 'RemoteUserDetailsStore', 'LocalUserDetailsStore' ], views: [ 'LoginView' ], name: 'TimeMobile', controllers: [ 'ctlLogin', 'ctlPlannedActivities' ], launch: function() { //this.TimeMobile =this; TimeMobile.app.LoggedUser =''; TimeMobile.app.LoggedUserPsw =''; TimeMobile.app.AnagId = 'CTEL'; TimeMobile.app.CurrentDate = new Date().toISOString(); TimeMobile.app.LoggedUserDetails = TimeMobile.model.mdlUserDetails(); Ext.create('TimeMobile.view.LoginView', {fullscreen: true}); }, getLoggedUserDetails: function(enabled) { if (enabled) { //var store= TimeMobile.app.LocalUserDetailsStore(); //return store.getAt(0); console.log('called'); } else { return null; } } }); </code></pre> <p>When I call <code>getLoadedUserDetails</code> with the syntax <code>TimeMobile.app.getLoadedUserDetails(true);</code> I get the error previously mentioned. <code>TimeMobile.getLoadedUserDetails(true);</code> does not work either.</p> <p>Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload