1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    31
    Vote Rating
    1
    billsalvucci is on a distinguished road

      0  

    Default associations getting set upon store.insert

    associations getting set upon store.insert


    I have a Contact model with a hasOne association to Address

    Code:
    hasOne: [
            {
                instanceName: 'address',
                associationKey: 'address',
                model: 'CrmApp.model.Address',
                getterName: 'getAddress',
                foreignKey: 'addressId',
                setterName: 'setAddress'
            }
    and code that inserts a newly constructed Contact into a store
    Code:
    var a = Ext.create('CrmApp.model.Contact');
    store.insert(0, a);
    when I inspect the variable a after it is created (before the store.insert), the association is not set, i.e. a.address is undefined.

    but if I inspect it after the store.insert call, it is set with data seemingly copied from another model instance from the store (probably the one that was currently selected in the grid?).

    I stepped into Store.insert and the address property is undefined until the line me.fireEvent('add', me, records, index);
    after that executes, it is set.

    As far as I know, I do not have any listeners on that event. Any idea where/why the associations are being set?

  2. #2
    Sencha User
    Join Date
    Sep 2012
    Posts
    31
    Vote Rating
    1
    billsalvucci is on a distinguished road

      0  

    Default


    mystery solved. I had a renderer which was calling getAddress. The getter will fetch the address. I changed the renderer to use the instance variable directory. i.e.

    contact.getAddress()

    changed to

    contact.address

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi