Created
December 10, 2014 23:34
-
-
Save kristianfreeman/2353cd68c0a0ff17733c to your computer and use it in GitHub Desktop.
implementing dynamic rowHeight per list-view item
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
heightForIndex: function(idx){ | |
var entry = this.get('content').objectAt(idx); | |
if (entry.get('rowHeight')) { | |
return entry.get('rowHeight'); | |
} else { | |
return this.rowHeight; | |
} | |
}, | |
updateRows: Ember.observer('[email protected]', function() { | |
// lodash dep here | |
_.each(this.get('childViews'), function(view) { | |
if (!view.get('isDestroying')) | |
view.set('rowHeight', view.get('content.rowHeight')); | |
}); | |
this._rowHeightDidChange(); | |
}), | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing ❤️