[CLOSED] JavaScript error in rejectChanges() method in Ext.NET's Store override

  1. #1

    [CLOSED] JavaScript error in rejectChanges() method in Ext.NET's Store override

    I am getting a JavaScript error when calling a Store's rejectChanges() method, saying "me" is not defined.

    This looks to be the relevant bit of code. I think "me = this" just needs to be added to the variable declarations, or maybe just use this?

    rejectChanges : function (actions) {
        var i, 
            len, 
            records,
            record;
        
        actions = Ext.apply({
            create : true,
            update : true,
            destroy : true
        }, actions || {});
        
        if (actions.create) {
            records = me.getNewRecords();
            len = records.length;
            
            if (len > 0) {
               for (i = 0; i < len; i++) {
                  record = records[i];
                  this.remove(record, true);
               }
            }
        }
        
        if (actions.update) {
            records = me.getUpdatedRecords();
            len = records.length;
            
            if (len > 0) {
               for (i = 0; i < len; i++) {
                  record = records[i];
                  record.reject();
               }
            }
        }
        
        if (actions.destroy) {
            records = me.getRemovedRecords();
            len = records.length;
            
            if (records.length > 0) {
               var autoSync = this.autoSync;
               this.autoSync = false;
               this.add(records);
               this.autoSync = autoSync;
               this.removed = [];
            }            
        }
    },
    Hope that helps.
    Last edited by geoffrey.mcgill; Jun 06, 2012 at 8:54 PM. Reason: [CLOSED]
  2. #2
    Hi Anup,

    Thanks for the report! Fixed in SVN, revision #4072.
  3. #3
    Thanks for the fix. Looks good; you can mark as closed.

Similar Threads

  1. Replies: 5
    Last Post: Dec 13, 2012, 8:27 AM
  2. [CLOSED] Ext .NET Override method best practice?
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 19, 2012, 12:50 PM
  3. [CLOSED] Override Button Method
    By softmachine2011 in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 05, 2012, 7:45 AM
  4. [CLOSED] Override getValue() javascript function from numberField
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 01, 2010, 6:26 PM
  5. About Store.rejectChanges method
    By sunny_sh in forum 1.x Help
    Replies: 2
    Last Post: Aug 09, 2009, 11:43 PM

Posting Permissions