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);

    }

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