Hi Guys. Just when I thought I finally had a handle on this scope stuff this event shows me I do not. The code snippet below is in a controller. Note that the reference to FPEOrderWindow is valid (works) in the Success function of getUnitByTag function. It then calls function moveUnit to process the data it got back from server. But in that function, it can not reference FPEOrderWindow, shows undefined in console.log. What is proper technique to fix this?
Code:
getUnitByTag : function() { Ext.Ajax.request({ url: '/valence/vvcall.pgm', scope: this, params: { pgm: 'VALV450', action: 'getByTag', tagno: this.getFPEOrderWindow().down('#NEWTAG').getValue(), order: this.getFPEOrderWindow().down('#FEORDER').getValue(), operno: this.getFPEOrderWindow().down('#FEOPER').getValue(), }, success: function (response) { var check = response.responseText; if (check) { var data = Ext.decode(response.responseText); if (data.SUCCESS === '1') { this.moveUnit(data); this.getFPEOrderWindow().down('#NEWTAG').setValue(''); } else { Ext.Msg.alert('Error-', data.MSG); } } else { Ext.Msg.alert('Received a null response from the server when attempting to get by tag.'); } }, failure: function () { Ext.Msg.alert('Received a failure response from the server when attempting to get by tag.'); } }) }, moveUnit : function(data) { console.log(this.getFPEOrderWindow().down('#FEINORD1').getValue());
Comment