DaveC426913
22 Oct 2010, 6:14 AM
This is a straight OOP thing. Not sure how it works within Ext.
My Session class, in a separate MERCON.session.js file:
In a nutshell, if the Ajax call fails to return in time, send a message to the txtMessage field in the UI.
Ext.ns('MERCON.session');
...
MERCON.session = {
login: function(){
// Ajax call
Ext.Ajax.request({
...
success: function(response, opts) {
...
},
failure: function(response, opts) {
setMessage("err","Having trouble logging in. Trying again. Try #" + this.retryCounter);
retryLogin();
},
});
My main stream index.js (that handles all UI). This is where the setMessage function is.
Ext.setup({
onReady: function() {
var main = new Ext.Panel({
... all my screen components
});
// functions
function setMessage(state,msg){
txtMessages.addClass(state)
txtMessages.update(msg)
}
}
});
Results in Uncaught ReferenceError: setMessage is not defined
My Session class, in a separate MERCON.session.js file:
In a nutshell, if the Ajax call fails to return in time, send a message to the txtMessage field in the UI.
Ext.ns('MERCON.session');
...
MERCON.session = {
login: function(){
// Ajax call
Ext.Ajax.request({
...
success: function(response, opts) {
...
},
failure: function(response, opts) {
setMessage("err","Having trouble logging in. Trying again. Try #" + this.retryCounter);
retryLogin();
},
});
My main stream index.js (that handles all UI). This is where the setMessage function is.
Ext.setup({
onReady: function() {
var main = new Ext.Panel({
... all my screen components
});
// functions
function setMessage(state,msg){
txtMessages.addClass(state)
txtMessages.update(msg)
}
}
});
Results in Uncaught ReferenceError: setMessage is not defined