1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    18
    Answers
    2
    Vote Rating
    1
    neoraptor is on a distinguished road

      0  

    Default Unanswered: Problem with List with dynamic field in model

    Unanswered: Problem with List with dynamic field in model


    Hello,

    I have a list that is linked with a store. This store is linked with a model.

    I added fields and validation dynamically with :
    for (var i = newFields.length - 1; i >= 0; i--){
    MyApp.model.patientModel.prototype.fields.add(new Ext.data.Field(newFields[i]));
    }

    This works fine wenn I insert data (validations works and fields are added to the D.


    The problem, is that my list does not display this dynamic fields (through itemTpl). The static fields in model are displayed correctly.
    Wenn I insert a new element, the dynamic fields are displayed in the list for this element.

    How could I update the list so that the dynamic fields are included?


    ‚ÄčAny help is welcome

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,821
    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 really should have your model setup with the fields you want at instantiation
    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
    Sencha User
    Join Date
    Jun 2012
    Posts
    18
    Answers
    2
    Vote Rating
    1
    neoraptor is on a distinguished road

      0  

    Default


    Is it not possible to update the model before displaying the list?
    I need to have a dynamic model for my application.

Thread Participants: 1

Tags for this Thread