Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: [OPEN-1039] JsonReader bug in 3.2.1 that affects Ext.data.ArrayStore

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #21
    Sencha User
    Join Date
    Mar 2010
    Location
    Baltimore, MD
    Posts
    33

    Default

    When a grid is used with JsonReader, it is displaying data from a database. It does not make sense to impose "." restrictions originating from JSON on data in a database

  2. #22
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    You're not getting my point!

    mapping: 'a.b' is supposed to mean {a: {b: 1}} and not {'a.b': 1}.

    Using '.' in property names is not recommended (because javascript also treats it as a child object property if you do not use [] notation).

  3. #23
    Sencha User
    Join Date
    Mar 2010
    Location
    Baltimore, MD
    Posts
    33

    Default

    Quote Originally Posted by Condor View Post
    You're not getting my point!

    mapping: 'a.b' is supposed to mean {a: {b: 1}} and not {'a.b': 1}.

    Using '.' in property names is not recommended (because javascript also treats it as a child object property if you do not use [] notation).
    I know why JavaScript does not like it, HOWEVER, JSON allows dots inside strings and so does JavaScript. ExtJS needs to handle this gracefully and not simply say that this is not allowed. At the least this should be documented somewhere.

    Additionally, in versions prior to 3.1, this worked because there was a try/catch block in createAccessor.

  4. #24
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    But dots already have a meaning in Javascript.

    They mean access of a property. This is what the mapping scheme does.

    If you want to use non-standard property names which contain dots, then inject an extractor function as a mapping.

  5. #25
    Ext JS Premium Member Juanito's Avatar
    Join Date
    Apr 2007
    Location
    San Diego->Boston->Brazil
    Posts
    164

    Default

    The solution to this is to set JsonReader#useSimpleAccessors to true, that will allow brackets and dots in field names without trying to access sub-objects

    By the way, for the people that are saying that we should not have fields with brackets or periods in names. In my current project, a database field can have many values (an array). That is denoted by havingh fieldName[0], fieldName[1] and so on. Also, when a field correlates to another, say a field is meant so express the unit to be used when entering data for another field, we use '.unit' at the end For example, weight is the field that stores the number and weight.unit is the field that stores what unit is being stored (Kg, Lbs, grams)

    So please don't try to tell people that field names should not have periods or special characters. The feature to access sub-objects with dot or bracket notation is the special case, it should not be the default.

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Bug in Ext.data.JsonReader?
    By mainmanmauricio in forum Ext 3.x: Help & Discussion
    Replies: 7
    Last Post: 22 Nov 2012, 3:35 AM
  2. Replies: 1
    Last Post: 18 Mar 2010, 12:44 PM
  3. [OPEN-58][3.0+] JsonReader with array data
    By Condor in forum Ext 3.x: Bugs
    Replies: 8
    Last Post: 20 Oct 2009, 2:43 AM
  4. [2.0] Firefox bug affects data.xmlReader
    By Gribnif in forum Ext 2.x: Bugs
    Replies: 0
    Last Post: 30 Jan 2008, 7:40 AM
  5. Ext.data.connection method is case sensitive (affects paged grid)
    By corey.gilmore in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 4 Apr 2007, 2:51 PM

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
  •