Skip to content

Commit

Permalink
Update ember-table to be compatible with EmberJS rc3
Browse files Browse the repository at this point in the history
In emberjs/ember.js@9014b5c there was an update to remove the defaultContainer global instantiation.

This broke ember-table because the LazyContainerView is created using the .create() method instead of view.createChildView().  The createChildView method will instantiate all of the container objects (and other childView *stuff*), whereas create() does not.

After this change, ember-table will be rc3 compatible.

Thanks to @stefanpenner for assisting in diagnosis.
  • Loading branch information
Andy Leeper committed Apr 29, 2013
1 parent eb65375 commit 1fd29fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ember-table.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ember-table.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/utils/lazy_container_view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Ember.LazyContainerView = Ember.ContainerView.extend Ember.StyleBindingsMixin,
.property 'numItemsShowing'

onNumChildViewsDidChange: Ember.observer ->
view = this
# We are getting the class from a string e.g. "Ember.Table.Row"
itemViewClass = Ember.get @get('itemViewClass')
newNumViews = @get 'numChildViews'
Expand All @@ -33,7 +34,7 @@ Ember.LazyContainerView = Ember.ContainerView.extend Ember.StyleBindingsMixin,
# if oldNumViews < newNumViews we need to add more views
else if numViewsToInsert > 0
viewsToAdd = [0...numViewsToInsert].map ->
itemViewClass.create()
view.createChildView(itemViewClass)
this.pushObjects viewsToAdd
, 'numChildViews', 'itemViewClass'

Expand Down

0 comments on commit 1fd29fd

Please sign in to comment.