Hybrid View

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    2
    nickelstar5 is on a distinguished road

      0  

    Default Configuration Objects Converted to String

    Configuration Objects Converted to String


    When adding configuration objects like Ext.window.Window.loader, the object is converted to a string. I was expecting it to be left as an object. In any case, the configuration does not work... either is ignored upon load or creates errors.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,352
    Vote Rating
    127
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    If there is a syntax error in your object definition, we will do this to protect you. We need to add in some better warning message to notify users what is going on.

    Are there any extra commas and/or variables/function calls that Architect cannot resolve?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    2
    nickelstar5 is on a distinguished road

      0  

    Default


    I don't think it's a formatting issue. To show a simplified example, I've attached 2 screenshots showing a loader config object that gets converted to a string. I should note that I tried wrapping the object in curly brackets as well but that too was converted. The pic on the left is the class definition with the object converted to a string. The right one is the editor for the config object.

    class_listing.PNGin_editing_mode.PNG

  4. #4
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    2
    nickelstar5 is on a distinguished road

      0  

    Default


    It looks like the object's property names must be wrapped in quotes. That's okay but isn't the way Architect or myself write them in our own code. Easy enough to do now that I've figured that out. However, there's still a problem if you want to assign a variable to a property like this:

    {'productNumber': myProductNumberVar }

    This gets converted to string even though it's a valid Javascript object.

  5. #5
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,352
    Vote Rating
    127
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    That's correct. It does not support variables/functions/JS expressions at this time.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  6. #6
    Ext JS Premium Member
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    2
    nickelstar5 is on a distinguished road

      0  

    Default


    Fair enough. Also, I did find at least one object editor that accepts property names without quotes: the 'editor' parameter on Grid columns. So it looks like the object editors are applying inconsistent formatting rules. Not a big deal but something to be aware of.

Thread Participants: 2