makes no sense to me but as long as i console.log(changedRecords) after my dirty routine and before my ajax routine it works fine.
Code:
onSaveTaxIdButton: function() { var changedRecords = []; for (c = 0; c < this.getStore('AP1099s').count(); c++) { if (this.getStore('AP1099s').data.items[c]["dirty"] === true) { var dirtyRecord = this.getStore('AP1099s').data.items[c]; changedRecords[c] = dirtyRecord; } } console.log(changedRecords); //as long as I put this in the plucker plucks.... if (changedRecords.length > 0) { var recs = Ext.Array.pluck(changedRecords, 'data'); Ext.getBody().mask(); Ext.Ajax.request({ url: 'vvcall.pgm', params: { pgm: 'ap1099zr', action: 'updateTaxID', changes: Ext.encode(recs) }, scope: this, success: function(response) { Ext.getBody().unmask(); var d = Ext.decode(response.responseText); if (d.SUCCESS === '1') { this.getStore('AP1099s').load(); Valence.util.msg('Saved', d.NUMBERSAVED + ' Tax ID Changes'); } else { Ext.Msg.show({ title: 'Error', msg: 'An error occurred....', icon: Ext.Msg.ERROR }); } } }); } },
Comment