Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User feiichi's Avatar
    Join Date
    Jul 2007
    Posts
    39
    Vote Rating
    0
    feiichi is on a distinguished road

      0  

    Default [OPEN-1270] Store#reMap doesn't respect filtered stores

    [OPEN-1270] Store#reMap doesn't respect filtered stores


    I've encountered a problem with filtered stores and the Store#reMap method which is called after a new record is inserted into a store and saved.

    The problem is it doesn't respect filtered stores, which leads to a nonfunctional Store#getById method:
    PHP Code:
    getById : function(id){
       return (
    this.snapshot || this.data).key(id);

    As you can see, the method takes in account this.snapshot, but after saving a new record, this is how the this.snapshot.keys referece looks like:
    Code:
    [48, 49, "ext-record-6"]
    Compared to this.data.keys:
    Code:
    [48, 49, 50]
    Also, when you clear filters with #clearFilter, the data property is replaced by the incorrect snapshot collection.

    I've only found one mention of this bug on the forums but with no official answer:
    http://www.sencha.com/forum/showthre...red-Stores-BUG

    I've also found several other discussions on problems with Store#reMap and DataReader#realize but with no mention of this issue:
    http://www.sencha.com/forum/showthre...r-Store.insert
    http://www.sencha.com/forum/showthre...utiple-records
    http://www.sencha.com/forum/showthre...ecord-creation

  2. #2
    Sencha User feiichi's Avatar
    Join Date
    Jul 2007
    Posts
    39
    Vote Rating
    0
    feiichi is on a distinguished road

      0  

    Default


    In case someone else needs a quick & dirty fix:
    PHP Code:
    Ext.override(Ext.data.Store, {
      
    reMap: function(record) {
        if (
    Ext.isArray(record)) {
          for (var 
    0len record.lengthleni++) {
            
    this.reMap(record[i]);
          }
        } else {
          function 
    alterHashMap(datarecord) {
            
    delete data.map[record._phid];
            
    data.map[record.id] = record;
            var 
    index data.keys.indexOf(record._phid);
            
    data.keys.splice(index1record.id);
          }
          
    alterHashMap(this.datarecord);
          if (
    this.snapshot) {
            
    alterHashMap(this.snapshotrecord);
          }
          
    delete record._phid;
        }
      }
    }); 

  3. #3
    Ext JS Premium Member
    Join Date
    Feb 2010
    Location
    Melbourne, Australia
    Posts
    9
    Vote Rating
    0
    markmansour is on a distinguished road

      0  

    Default


    Thanks so much feiichi. I just ran into this issue today.

    Sencha people. Has this been fixed in later versions of ExtJs (I'm using 3.4.0).

Similar Threads

  1. Replies: 11
    Last Post: 29 Dec 2010, 2:45 PM
  2. [OPEN-1133] Store#reMap method and filtered Stores
    By wprater in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 17 Jul 2010, 6:38 AM
  3. Store#reMap method and filtered Stores BUG?
    By wprater in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 14 Jul 2010, 7:09 PM
  4. Ext.data.Store: insert support for Filtered Stores
    By durlabh in forum Community Discussion
    Replies: 3
    Last Post: 22 Sep 2009, 10:55 PM
  5. Replies: 12
    Last Post: 8 Mar 2009, 4:44 PM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar