Results 1 to 3 of 3

Thread: Problem with List with dynamic field in model

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    18
    Answers
    2
    Vote Rating
    1
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You really should have your model setup with the fields you want at instantiation
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    18
    Answers
    2
    Vote Rating
    1
      0  

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •