-
1 Aug 2012 5:36 AM #1
store is not updated after the setting of a extraParams
store is not updated after the setting of a extraParams
Hi All,
I am not getting the updated value from store after the setting of extraParams and the whole logic is in the "OnSubmitButton" function of a controller and I had already set the extraParams in the "OnSubmitButton" function itself only, also given the load() function in the "OnSubmitButton" function and I want to print the upadated Store data in the "OnSubmitButton" function only i.e.(console.log("The return value is="+nm)
, I am not getting the updated value of nm in the session of a "OnSubmitButton" function.
Below is my controller (OnSubmitButton function ):
onSubmitButton: function(btn, evt){
var txt = Ext.ComponentQuery.query('#txt')[0].getValue();
var pwd = Ext.ComponentQuery.query('#pwd')[0].getValue();
console.log(pwd);
var jobsStore = Ext.getStore('Login');
jobsStore.getProxy().setExtraParam('Un',txt);
jobsStore.getProxy().setExtraParam('Pd',pwd);
jobsStore.load();
if(nm==1)
{
Ext.Msg.alert("Login in Successful");
this.activateLogin();
}
else{
Ext.Msg.alert("Enter the correct User Name and password");
}
},
Output is:
sharadc /samples/IHGProject/app/controller/Notes.js?_dc=1343827786453:133
Pyramid1234 /samples/IHGProject/app/controller/Notes.js?_dc=1343827786453:137
The return value is=6 /samples/IHGProject/app/controller/Notes.js?_dc=1343827786453:156
- Resource interpreted as Script but transferred with MIME type text/html: "http://10.4.3.199/SenchaTest/Default...sonP.callback2". sencha-touch-debug.js:12619
Correct Output should be:
The return value is=1 ,
( i.e 6 is oudated value and 1 is updated value)
Please Suggest me....................
Thanks and Regards.
-
3 Aug 2012 5:19 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,608
- Vote Rating
- 435
Did you make sure txt is the correct value? I change extraParams and works for me.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Sep 2012 12:01 AM #3
vipsshan is your friend?
jsonp is async request.
Your should do this:
Code:var loginStore=Ext.getStore('Login'); loginStore.load(function(records){ var nm=loginStore.getAt(0).get('ret');//or nm=records.getAt(0).get('ret') if(nm==1){ Ext.Msg.alert("Login in Successful"); this.activateLogin(); } else{ Ext.Msg.alert("Enter the correct User Name and password"); } });


Reply With Quote