Skip to content

Commit

Permalink
Fix #202: implement _destroyColumns properly for ColumnSet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth G. Franqueiro committed Jun 20, 2012
1 parent 2f13b87 commit a170ee8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions ColumnSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ function(kernel, declare, Deferred, listen, aspect, query, has, put, hasClass, G

positionScrollers(this, domNode);
},

_destroyColumns: function(){
var columnSetsLength = this.columnSets.length,
i, j, k, subRowsLength, len, columnSet, subRow, column;
for(i = 0; i < columnSetsLength; i++){
columnSet = this.columnSets[i];
for(j = 0, subRowsLength = columnSet.length; j < subRowsLength; j++){
subRow = columnSet[j];
for(k = 0, len = subRow.length; k < len; k++){
column = subRow[k];
if(typeof column.destroy === "function"){ column.destroy(); }
}
}
}
},
configStructure: function(){
this.columns = {};
for(var i = 0, l = this.columnSets.length; i < l; i++){
Expand Down
2 changes: 1 addition & 1 deletion Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function(kernel, declare, listen, has, put, List){
// immediately before configuring a new column structure.

var subRowsLength = this.subRows.length,
i, j, column;
i, j, column, len;

// First remove rows (since they'll be refreshed after we're done),
// so that anything aspected onto removeRow by plugins can run.
Expand Down

0 comments on commit a170ee8

Please sign in to comment.