1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    17
    Vote Rating
    0
    tadhg is on a distinguished road

      0  

    Default Unanswered: Custom properties disappear after production build?!

    Unanswered: Custom properties disappear after production build?!


    I'm running into a problem when building my app. Here's the code:

    Code:
    {
        height: 150,
        xtype: 'img',
        toggleribbon: 'close',
        cls: 'ribbon-button-off',
        imageurl: picture.get('url')
    }
    The issue is, it seems that the imageurl property doesn't exist in the production build, but it works fine in the dev version.

    This is an image I'm adding to a Carousel, and just before adding I log the following:

    Code:
    console.log(ribbon);
    console.log(ribbon.imageurl);
    In dev they print out fine, and I can expand the object in the console and see the imageurl property. Then in the build version it's no longer there.

    Any ideas what's happening?

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    17
    Vote Rating
    0
    tadhg is on a distinguished road

      0  

    Default Solved

    Solved


    I found a solution. It appears I can access those properties through the config property. Not sure if this is the right way, and why in dev I can get to the properties directly, but for now this works. If this isn't best practice I would appreciate the heads up.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    37
    Answers
    1
    Vote Rating
    1
    DonM is on a distinguished road

      0  

    Default


    Had the same issue and spent hours trying dozens of tweaks before I found this post, thanks for updating with your solution. Even if we aren't sure if its the offical one at least its better then the app breaking everytime you try a production build


    For clarification on his solution using his example, when he changes:
    Code:
    console.log(ribbon.imageurl);
    to
    Code:
    console.log(ribbon.config.imageurl);
    it will show the custom property fine.

  4. #4
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    851
    Answers
    59
    Vote Rating
    32
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

    Default


    I had the same issue. I think this is a bug. Maybe move this thread to the bug forum.

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Vote Rating
    0
    Corcho is on a distinguished road

      0  

    Default


    Had the same issue. On dev mode works ok, but when I do "sencha app build native" those custom properties are not accessable via "comp.customProp". "comp" is not a defined class, but it's an item of a container, so instead of using getters and setters I had to use "comp.config.customProp".

    However we manage to work arround this, I'd like to know if this is a bug or what?

    Thanks.

Thread Participants: 3