I have login page with UserId , Password and Submit button. after click of submit button first time I am not getting correct result but clicking of submit button again(Second time ) get Correct result. Could you please give me a idea for resolving this problem.
My codes are :- Store:
var txt = Ext.ComponentQuery.query('#txt')[0].getValue();
console.log(txt);
var pwd = Ext.ComponentQuery.query('#pwd')[0].getValue();
console.log(pwd);
var ps=Ext.getStore('Login').getAt(0).get('userPassword');
var nm=Ext.getStore('Login').getAt(0).get('ret');
console.log("return value is="+nm);
var loginStore = Ext.getStore('Login');
loginStore.getProxy().setExtraParam('Un', txt);
loginStore.getProxy().setExtraParam('Pd', pwd);
loginStore.load();
if(nm==1)
{
Ext.Msg.alert("Login in Successful");
this.activateLogin();
}
else{
Ext.Msg.alert("Enter the correct User Name and password");
}
},