Skip to content

Commit

Permalink
Fix for GH dgrid issue dojo#489.
Browse files Browse the repository at this point in the history
Updated _StoreMixin to reset _columnsWithSet only when configStructure() is called,
rather than resetting it everytime _configColumns() is called because
_configColumns() is called multiple times for column configurations
containing subRows.
  • Loading branch information
brandonpayton committed Mar 26, 2013
1 parent cbf15b2 commit 0bf4948
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions _StoreMixin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/Deferred", "dojo/on", "put-selector/put"],
function(kernel, declare, lang, Deferred, listen, put){
define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/Deferred", "dojo/on", "dojo/aspect", "put-selector/put"],
function(kernel, declare, lang, Deferred, listen, aspect, put){
// This module isolates the base logic required by store-aware list/grid
// components, e.g. OnDemandList/Grid and the Pagination extension.

Expand Down Expand Up @@ -62,25 +62,22 @@ function(kernel, declare, lang, Deferred, listen, put){
this.queryOptions = {};
this.dirty = {};
this._updating = {}; // tracks rows that are mid-update

// reset _columnsWithSet for a new column configuration
aspect.before(this, "configStructure", lang.hitch(this, function(){
this._columnsWithSet = {};
}));
},

_configColumn: function(column){
// summary:
// Implements extension point provided by Grid to store references to
// any columns with `set` methods, for use during `save`.
if (column.set){
if(!this._columnsWithSet){ this._columnsWithSet = {}; }
this._columnsWithSet[column.field] = column;
}
},

_configColumns: function(){
// summary:
// Extends Grid to reset _StoreMixin's hash when columns are updated
this._columnsWithSet = null;
return this.inherited(arguments);
},

_setStore: function(store, query, queryOptions){
// summary:
// Assigns a new store (and optionally query/queryOptions) to the list,
Expand Down

0 comments on commit 0bf4948

Please sign in to comment.