Results 1 to 4 of 4

Thread: Is there any idea if i want pause all opperation and resume?

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    45
    Answers
    1

    Default Is there any idea if i want pause all opperation and resume?

    I want something like
    Code:
       Ext.getStore('userStoreField').load(function(record, operation, success){
            if(success){
               //creat win popup form user register
           }
       });
    Above it works for ajax only. example i have 1 button click to popup new window create new users.

    But example i want handle all stores access to server will return "login_requred" if session lose and show popup win login instead (this one also i success) with this code:
    Code:
    //In app file
    /**
     * This All ajax store will hook
     */
    Ext.data.StoreManager.on('add', function (i, store) {
                store.on('load', function (st) {
                    var rawData = st.getProxy().getReader().rawData;
                    if(rawData){
                        if(rawData=='login_required'){
                            //  In here userStoreField store return 'login_required' so need
                            //show popup win login form instead 
                         }
                    }
                })
    });
    My problem win login from show success, but win user register also show because i don't know how to pause all operation and i want resume operation after re-login success.

  2. #2
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    You may be able to make use of the beforerequest event from Ext.data.Connection.

    Code:
    Ext.data.Connection.on({
        beforerequest: function () {
            if (MyApp.signedIn === true || MyApp.signedIn === 'signing-in') {
                return true;
            } else {
                // popup your login window for the user to log in and in the response you can
                // resume requests - set the signedIn app property to true
                // something to that effect.
            }
        }
    });

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    45
    Answers
    1

    Default

    Sorry for not clear, if i have one button name "Add User" when click will show popup window register form ( My user register form's items are generate from server by using store proxy to get all items attributes then loop generate to fields e.g first name, last name, gender ...) when click button "Add User" :
    1. Get form items from database via store proxy ( in here when session lost will return only word "login_required"
    2. create form panel
    3. loop and generate items to form user register
    Mention on number 1 when session lost my store return "login_required" then my login form appear, but number 2, and 3 are still process ( Result register form popup window will show blank, mean that no items first name, last name, gender... so no need pop up window that what i want ) that is my real problem.

    To sum up if number 1 know session lost number 2,3 should pause and will resume after login.

  4. #4
    Sencha User
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    If you're pulling down the form fields from your server dynamically as the form is created you might use the loader config for the form:
    http://docs.sencha.com/extjs/4.2.1/#...nel-cfg-loader

    With that you can point to the server script that will return the items used in that form as returned from a database, etc.

Posting Permissions

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