Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: [4.1.0] 'id' field leak

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6213 in a recent build.
  1. #1
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,016
    Vote Rating
    182
      3  

    Default [4.1.0] 'id' field leak

    Code:
    Ext.define('foo', {
       extend : 'Ext.data.Model',
       fields : ['bar']
    });
    
    foo.prototype.fields.length; ==> 2
    Seems the 'id' field leaks into all subclassed models (breaks deserialization in ASP.NET for example).

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,388
    Vote Rating
    499
      0  

    Default

    Thank you for the report.

    Regards,
    Scott.

  3. #3
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    262
    Vote Rating
    79
      0  

    Default

    Any updates on this one? I and probably most of developers would like this fixed.
    id field should be default, but using some property we should be allow to overwrite this.

    Something like:
    Code:
    Ext.define('foo', {
       extend : 'Ext.data.Model',    
       idProperty : 'Id',//this is what we need!
       fields : [{name : 'Id', type : 'string'},//here I would like to store user guid
                 {name : 'Name', type : 'string'},
                 {name : 'Department', type : 'string'}] 
      });
    It isn't so hard to fix I guess

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Any update on this? It is causing major problems for us.

  5. #5
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,388
    Vote Rating
    499
      0  

    Default

    This is currently slated for the 4.2 release.

    Scott.

  6. #6
    Sencha User
    Join Date
    Jul 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default

    What is the estimated release date for 4.2?

  7. #7
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,388
    Vote Rating
    499
      0  

    Default

    In the near future

    There is no public release date at this time.

    Scott.

  8. #8
    Sencha User Misiu's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    262
    Vote Rating
    79
      0  

    Default

    I know that 4.2 beta was released just couple of hours ago, but is this tiny bug fixed in this release?

  9. #9
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,016
    Vote Rating
    182
      0  

    Default

    If you use 'idProperty', the bug is not reproducible.

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      1  

    Default

    It's not really a "leak"

    It creates an id field for you based upon the default idProperty in Models which is "id"

    A Model must have some identifier.

    But if you really do not want that (eg an abstract base Model class), then you can

    Code:
    Ext.define('foo', {
       idProperty: null,  // No identifying field in this Model
       extend : 'Ext.data.Model',
       fields : ['bar']
    });

Page 1 of 2 12 LastLast

Posting Permissions

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