Wednesday, 18 September 2013

Cannot call method of on of undefined

Cannot call method of on of undefined

I was wondering if someone could tell me why the below code is not
working. The first 2 on functions are working and then the last on
function is not working and I am getting the error message "cannot call
method of on of undefined."
It seems to not like this line, textF.getEl().on('click', function() {
bUpdateSwitch.on({'click': function (){ var textF =
Ext.getCmp('switchStatus');
textF.enable();
textF.setReadOnly(false);
var textValue = textF.getValue();
if(textValue && Ext.isString(textValue) &&
(textValue.toUpperCase().indexOf("O") != -1 ||
textValue.toUpperCase().indexOf("R") != -1 ||
textValue.toUpperCase().indexOf("P") != -1))
{
textF = Ext.getCmp('cbServCarrier');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('rateAuthorityType');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('rateAuthorityId');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('rateAuthorityNumber');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('rateAuthorityItem');
textF.enable();
textF.setReadOnly(false);
}
}});
bUpdateSwitch.on({'click': function (){
var textF = Ext.getCmp('cbServCarrier');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('cbSwitchFSAC');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('industryComment');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('physicallyServed');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('cbPrivateCarrier');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('cbStation');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('cbStationFSAC');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('scrsEDate');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('accountingEDate');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('scrsExDate');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('accountingExDate');
textF.enable();
textF.setReadOnly(false);
textF = Ext.getCmp('changeDescription');
textF.enable();
textF.setReadOnly(false);
}});
bUpdateSwitch.on({'click': function (){
var textF = Ext.getCmp('rateSummary');
textF.enable();
textF.getEl().on('click', function() {
Ext.getCmp('rtCurrency').enable();
Ext.getCmp('rtCurrency').setReadOnly(false);
Ext.getCmp('rtAccEffDate').enable();
Ext.getCmp('rtAccEffDate').setReadOnly(false);
Ext.getCmp('rtAccExDate').enable();
Ext.getCmp('rtAccExDate').setReadOnly(false);
Ext.getCmp('rtJctR260').enable();
Ext.getCmp('rtJctR260').setReadOnly(false);
Ext.getCmp('switchRate').enable();
Ext.getCmp('switchRate').setReadOnly(false);
Ext.getCmp('minRateCharge').enable();
Ext.getCmp('minRateCharge').setReadOnly(false);
Ext.getCmp('maxRateCharge').enable();
Ext.getCmp('maxRateCharge').setReadOnly(false);
Ext.getCmp('rtZone').enable();
Ext.getCmp('rtZone').setReadOnly(false);
Ext.getCmp('rtAddMile').enable();
Ext.getCmp('rtAddMile').setReadOnly(false);
Ext.getCmp('rtTarAppCd').enable();
Ext.getCmp('rtTarAppCd').setReadOnly(false);
Ext.getCmp('rtDetailSPLC').enable();
Ext.getCmp('rtDetailSPLC').setReadOnly(false);
Ext.getCmp('locationId1').enable();
Ext.getCmp('locationId1').setReadOnly(false);
Ext.getCmp('locationId2').enable();
Ext.getCmp('locationId2').setReadOnly(false);
Ext.getCmp('rtSettleCd').enable();
Ext.getCmp('rtSettleCd').setReadOnly(false);
Ext.getCmp('rtDetailNumber').enable();
Ext.getCmp('rtDetailNumber').setReadOnly(false);
Ext.getCmp('rtDetailId').enable();
Ext.getCmp('rtDetailId').setReadOnly(false);
Ext.getCmp('rtDetailType').enable();
Ext.getCmp('rtDetailType').setReadOnly(false);
Ext.getCmp('rtDetailItem').enable();
Ext.getCmp('rtDetailItem').setReadOnly(false);
Ext.getCmp('rtZTS1').enable();
Ext.getCmp('rtZTS1').setReadOnly(false);
Ext.getCmp('rtZTS2').enable();
Ext.getCmp('rtZTS2').setReadOnly(false);
});
}})

No comments:

Post a Comment