Hybrid View

  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Romania
    Posts
    37
    Vote Rating
    0
    oana0211 is on a distinguished road

      0  

    Default var nul when SetValue

    var nul when SetValue


    Hello,

    I develop a mobile app using sencha touch 2. I have a model that map a rest url. In my controller when I create the model and after I setValue from the component the variable is null even in the console log has values.
    WHat I made wrong?

    ===model===
    Ext.define("IBMobile.model.AccountDetails", {
    extend : "Ext.data.Model",
    config : {

    idProperty : 'accountId',
    fields : [{
    name : 'accountId',
    type : 'int'
    }, {
    name : 'alias',
    type : 'string'
    }

    ],

    validations : [{
    type : 'presence',
    field : 'accountId'
    }],
    proxy : {
    type : 'rest',
    url : 'rest/account/details',
    listeners : {
    exception : function(proxy, response, operation) {
    Ext.Msg.alert(Ux.locale.Manager
    .get('payments.validationMsg.err'),
    response.responseText);

    }}}}
    });

    ===controller function===
    viewAccountDetails : function(list, record) {
    var accountDetails = Ext
    .create("IBMobile.view.Accounts.AccountDetails");
    this.getMainNavigation().push(accountDetails);
    console.dir(record);
    var accDetails = Ext.create('IBMobile.model.AccountDetails', {
    accountId : record.data.accountId

    });
    accDetails.save();

    console.log('====');
    console.log(accDetails);

    Ext.getCmp('alias').setValue('Alias'+accDetails.get('accountId') + accDetails.get('alias'));

    },
    ===

    The accDetails variable in console log has all the propeties set inclusive alias but when I set value for the component alias it is null. How it's posible?

  2. #2
    Sencha User
    Join Date
    May 2012
    Location
    Romania
    Posts
    37
    Vote Rating
    0
    oana0211 is on a distinguished road

      0  

    Default


    i've solved .

    var accountDetailsModel = Ext.ModelMgr.getModel('AccDetails');

    accountDetailsModel.load(record.data.accountId, {
    success: function(accDetails) {

    Ext.getCmp('accountType').setValue(accDetails.data.groupName);

    }

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