Habilitar classificação dinâmica em Ember-Table

Ember-Table é uma ótima maneira de exibir seus dados tabulares em ember com alguns recursos realmente interessantes, como colunas arrastáveis, carregamento lento, etc. Não tenho certeza se isso funcionará bem com fontes de dados preguiçosos, mas se você pode usar arrangedContentem seu controlador, você pode adicionar a grandeza de clicar em colunas com apenas algumas funções / sobrecargas:

App.VeryOwnTableController = Ember.Table.TableController.extend Ember.SortableMixin,
hasHeader
: yes
sortAscending
: yes
sortProperties
: ['firstName']

sortByColumn
: (column)->
# Toggle sort order for second press on same column
if Ember.isEqual (column.get 'contentPath'), (@get 'sortProperties')[0]
@toggleProperty 'sortAscending'
else
@set 'sortProperties', [column.get 'contentPath']
@sort()

sort
: ->
#Make sure we re-render on a sort order change
@propertyWillChange 'content'
(@get 'arrangedContent').sort()
@propertyDidChange 'content'

bodyContent
: Ember.computed ->
# overload bodyContent to bind to arrangedContent rather than content
Ember.Table.RowArrayProxy.create
tableRowClass
: Ember.Table.Row
content
: @get 'arrangedContent'
.property 'content'

_contentWillChange
: Ember.beforeObserver ->
# Must overload this, or SortableMixin upchucks
console
.log "do nothing here"

columns
: # Define as usual -- use contentPath for this to work as advertised