Skip to content

Instantly share code, notes, and snippets.

@jrhe
Created November 26, 2014 18:23
Show Gist options
  • Save jrhe/ce9166512517da441a32 to your computer and use it in GitHub Desktop.
Save jrhe/ce9166512517da441a32 to your computer and use it in GitHub Desktop.
Observer problem
export default Ember.Component.extend({
selection: [],
columns: function() {
return this.get('columnDefinitions').map(function(colDef) {
return fluidColumn.create(colDef);
});
}.property('columnDefinitions'),
selectionChanged: function() {
console.log('in selection changed');
}.observes('selection'),
columnDefinitions: [
{
columnWidth: 90,
textAlign: 'text-align-left',
headerCellName: 'Score',
contentPath: 'score'
},
{
columnWidth: 150,
textAlign: 'text-align-left',
headerCellName: 'Author',
contentPath: 'author'
},
{
columnWidth: 150,
textAlign: 'text-align-left',
headerCellName: 'Type',
contentPath: 'type'
},
{
columnWidth: 150,
textAlign: 'text-align-left',
headerCellName: 'Created',
contentPath: 'created'
},
{
columnWidth: 150,
textAlign: 'text-align-left',
headerCellName: 'Bate',
contentPath: 'bate'
}
]
});
.search-results.stack-item
ul.container-fluid
= table-component hasFooter=false enableContentSelection=true rowHeight=24 columns=columns content=results selection=selection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment