Results 1 to 2 of 2

Thread: how to make Synchronus loading of store after setting of extraParams

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    17
    Vote Rating
    0
      0  

    Default how to make Synchronus loading of store after setting of extraParams

    Hi All,
    My problem is that there is not Synchronus loading of store taking place after the setting of extraParams ,
    but in my code store is loading Asynchronusly due to which I am getting outdated result instead of updated result. I want to know that is there is any function of store which can load store Synchronusly in Sencha Touch 2 ?

    Below is my Controller:

    onSubmitButton: function(btn, evt)
    {


    var txt = Ext.ComponentQuery.query('#txt')[0].getValue();


    console.log(txt);
    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(); // here i want something which can load the store Synchronusly not Asynchronusly


    var nm=Ext.getStore('Login').getAt(0).get('ret');
    console.log("The return value is="+nm);


    if(nm==1)
    {
    Ext.Msg.alert("Login in Successful");
    this.activateLogin();
    }
    else{
    Ext.Msg.alert("Enter the correct User Name and password");
    }


    },

    Please reply me..............

    Thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    I would 100% stay away from a sync ajax request. The reason is your whole app will absolutely freeze, nothing will work while that request is being sent and received. It is much better to use the events or callback in an async request.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •