1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    21
    Vote Rating
    1
    brian.scott@talgov.com is an unknown quantity at this point

      0  

    Default Unanswered: Documentation Mix Up / Code Mix Up? -- Ext.data.Model.get(fieldName)

    Unanswered: Documentation Mix Up / Code Mix Up? -- Ext.data.Model.get(fieldName)


    Hello friends -

    Here is my code:
    // OK. GET OUR STORE.
    var store = Ext.data.StoreManager.lookup('loginJsonStore');
    // GET ACCESS TO THE TEXT FIELD.
    var userNameTextBox = Ext.getCmp('userNameField');
    var passwordTextBox = Ext.getCmp('passwordField');
    store.getProxy().setExtraParams({userName:userNameTextBox.getValue(),
    password: passwordTextBox.getValue()});
    // SEE IF WE CAN GET SOMETHING.
    store.load();
    // LETS TRY TO POPULATE OUR VALUE.
    console.log("debug alpha");
    var loginModelRef = Ext.data.ModelManager.getModel('MyFirstTestApplication.model.loginModel');
    console.log(loginModelRef.prototype.fields);
    console.log("debug beta");
    var theModelField = loginModelRef.get("successOrFailureSw");
    console.log("debug gamma");
    console.log(theModelField);
    I am attaching a screenshot of the Chrome console, but the upshot is that I get success at server response time in regards that it gets my request based on the values that the user enters; but I get a failure at loginModelRef.get("successOrFailureSw") call. Specifically, it reads:

    Object function (){return this.constructor.apply(this,arguments)} has no method 'get'


    Curiously, the documentation set for Ext.data.Model states there is a get(fieldName) method.

    I'm almost certainly doing something wrong. What is it?

    Thanks.
    brian
    Attached Images

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,824
    Answers
    3470
    Vote Rating
    836
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You are doing it on a class but you need to do this on an instance...

    Code:
    var rec = store.getAt(1),
        value = rec.get('fieldname');
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread