Results 1 to 6 of 6

Thread: Model: Mapping on the field is not working with the Testing and Production

  1. #1
    Sencha User
    Join Date
    Mar 2014
    Posts
    8

    Default Answered: Model: Mapping on the field is not working with the Testing and Production

    Hi all,

    I have defined a model like this:

    Ext.define('OnSite.model.Address', {

    extend: 'Ext.data.Model',

    fields: [
    { name: 'presentationString', mapping: 'tekst' },
    { name: 'detailLink', mapping: 'adgangsadresse.href' },
    { name: 'addressAccessId', mapping: 'adgangsadresse.id' }
    ]
    });


    It's working fin the dev environt BUT not with the testing and production. Debug and inspect the data of record having only the id property whereas the rawdata is returned correctly. I suppose there is a difference in the sencha touch lib between the dev version and the others.

    Note: I am using the Sencha Touch 2.4

    Cheers,
    Thach

  2. Hi--

    Put the "fields" with in the "config:{}" block. That should resolve the issue.

    Thanks!
    Joel

  3. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi Thach--

    Can you share an example of the data you're having an issue with?

    Thanks
    Joel

  4. #3
    Sencha User
    Join Date
    Mar 2014
    Posts
    8

    Default

    Hi Joel,

    Here you are:
    Code:
    [
    {
      "tekst": "Aggershvile Alle 1, 2942 Skodsborg",
      "adgangsadresse": {
        "id": "0a3f507d-a017-32b8-e044-0003ba298018",
        "href": "http://dawa.aws.dk/adgangsadresser/0a3f507d-a017-32b8-e044-0003ba298018",
        "vejnavn": "Aggershvile Alle",
        "husnr": "1",
        "supplerendebynavn": null,
        "postnr": "2942",
        "postnrnavn": "Skodsborg"
      }
    }
    ]
    Cheers,
    Thach

  5. #4
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    Put the "fields" with in the "config:{}" block. That should resolve the issue.

    Thanks!
    Joel

  6. #5
    Sencha User
    Join Date
    Mar 2014
    Posts
    8

    Default

    You are the best, Joel :-)! I did a copy of the model defined in the Ext 4.1 and missed this important change although it has in my new model classes in the Sencha Touch project. Anyways, thank you so much!

  7. #6
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Awesome, glad it helped!

    Thanks!
    Joel

Similar Threads

  1. Replies: 2
    Last Post: 8 Apr 2015, 9:57 AM
  2. [CLOSED] Model Mapping not working
    By sg707 in forum Ext 5: Bugs
    Replies: 2
    Last Post: 1 Dec 2014, 10:02 PM
  3. Model field mapping problem
    By dbarbakadze in forum Ext: Discussion
    Replies: 2
    Last Post: 11 Sep 2014, 1:47 AM
  4. [Solved] Testing JsonStore if obj field mapping exists
    By SlashEMc2k in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 5 Aug 2010, 11:03 AM

Posting Permissions

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