1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    9
    Vote Rating
    0
    EdPS is on a distinguished road

      0  

    Default Adding fields to a model

    Adding fields to a model


    I've got a model where most of the fields' values come from an ajax proxy. However, I want to add a few more fields that are processed by the app. Is there an elegant way to do this within the model's definition? Like having a conversion function that takes the data from a field and stores the result in a new field (not overwriting the original one). I created the method but don't know where to call it from.

    Thanks

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,731
    Vote Rating
    754
    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 should have your fields defined upfront.
    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.

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    529
    Vote Rating
    17
    estesbubba will become famous soon enough

      0  

    Default


    Override the model's editEdit() function and populate the fields that your proxy didn't.

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2011
    Location
    Netherlands
    Posts
    87
    Vote Rating
    0
    macs is on a distinguished road

      0  

    Default


    you could use the convert function as suggested here http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Field
    under "types and conversions". hope this helps

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Posts
    10
    Vote Rating
    -1
    coloenz is an unknown quantity at this point

      -1  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    You should have your fields defined upfront.
    what is this for crap answer!
    if you don't feel like answering in a polite manner then please say nothing!

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,731
    Vote Rating
    754
    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


    Quote Originally Posted by coloenz View Post
    what is this for crap answer!
    if you don't feel like answering in a polite manner then please say nothing!
    Don't see how this is a non-polite answer. Did you read some sort of tone in this text that isn't there?
    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.

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