Here is how to sort a table using Ember. I personally think this is kind of awkward. Defining an array of column objects is awkward. You could define a isSortedXXXAsc and isSortedXXXXDesc for each column, but I think this is worse. It adds more logic into the template and makes things more brittle. This example is slightly brittle because you must reorder the columns property and the markup to do display the table--but no logic changing is required. That being said, here's how it works.
Your new post is loading...