Hybrid View

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    Payoffice is on a distinguished road

      0  

    Default when store config variables are initialized.

    when store config variables are initialized.


    Hello,

    I am new to ExtJs and I face the following problem.
    I have two functions that initialize two stores initStore1() et initStore2() and a member variable this.id. This function are called in that order:
    Code:
    Ext.apply(this, {
    id: -1;
    })
    initStore1();
    initStore2();
    The content of that function are the following:
    Code:
    function: initStore1() {
    var store: nex Ext.data.Store({
    ...
    listeners: {
    load: {
    scope: this,
    fn: function(store, record) {
    ...
    this.id = record.get('id');
    }
    }
    }
    })
    }
    
    function: initStore2() {
    var store2: nex Ext.data.Store({
    ...
    baseParams: {
    ...
    where: "id" = this.id//here this.id is equal to -1 instead of the value present in store1
    },
    ...
    }
    })
    }
    my problem is taht this.id is equal to -1 when initStore2 is called.
    How can I initialize this.id so that it will be initialize before initStore2 is called?

    Regards

  2. #2
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    Payoffice is on a distinguished road

      0  

    Default


    No answer?
    I think my problem can be solved if I can load synchronously my stores.
    Any idea?

    Regards,

    Payoffice

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    541
    Vote Rating
    50
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    If I'm understanding the issue, why don't you call initStore2() in the load listener of initStore1() and pass the id?

    e.g:
    Code:
    function: initStore1() {
        var store: new Ext.data.Store({
            listeners: {
                load: {
                    scope: this,
                    fn: function (store, record) {
                        this.id = record.get('id');
                        initStore2(this.id)
                    }
                }
            }
        });
    }
    
    
    function: initStore2(id) {
        var store2: new Ext.data.Store({
            baseParams: {
                where: id 
            }
        });
    }

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    Payoffice is on a distinguished road

      0  

    Default


    hum, I will try it.

    Regards,

    Payoffice

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar