1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    61
    Vote Rating
    1
    dgherrig is on a distinguished road

      0  

    Default Model Names do not allow spaces

    Model Names do not allow spaces


    Hi,

    The dataIndex names in my view have spaces in them, for example " Manager Class". However, when adding name to the Model it does not allow a name with spaces in it. Thus, after I deploy, I have to manually change the model names to match the dataIndex in the view and then everything works fine.

    Is this a bug or is there a work-around for this probem.

    Thanks Much for any help with this.

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,264
    Vote Rating
    80
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Very rare use case for naming fields (dataIndex).

    I guess your server code is in MS technology 'cause MS is the only one I saw encourages developers to use spaces in database field names.

    I don't think is a bug but a feature since 99.9% of the developers I know don't use spaces in identifiers. Just change your server code to send field names without spaces: "ManagerClass" or "Manager_Class" instead of "Manager Class".

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 & 5
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: Glassfish / WildFly
    Databases: Oracle / DB2 / MySQL / Firebird

    If you like my answer please vote!

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    25
    Vote Rating
    0
    echobloom is on a distinguished road

      0  

    Default


    Super late on this, but if anybody has the same problem, the original answer here isn't correct. You can have models with spaces in the returned JSON, you just can't have spaces in the actual field name in the model. Example:

    Code:
    JSON: 
    {
        "fieldMasterCategory": {
            "Some Crazy Category Name ^&*": 42
        },
    }  
    
    Field definition in your model:
            {
                name: 'someFieldName',
                type: 'string',
                mapping: 'fieldMasterCategory',
                convert : function(val, record) {
                    return val['Some Crazy Category Name ^&*'];
                }
            },

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi