sortByColumn: function(colName) {
this.sortKey = colName;
this.sort();
}
events: {
'click #things thead th': 'sortThingsByColumn'
}
sortThingsByColumn: function(event) {
var column = event.currentTarget.classList[0]
this.collections.things.sortByColumn(column)
this.render()
}
sortByType: function(type) {
this.sortKey = type;
this.sort();
}
sortThingsByColumn: function(event) {
var type = event.currentTarget.classList[0]
this.collections.things.sortByType(type)
this.render()
}
event.currentTarget.classList[0] does as it might not return the radio button value.model: Tree:sortKey: 'name',
comparator: function(item) {
return this.sortKey === 'name'
? -item.get(this.sortKey)
: item.get(this.sortKey)
},
You are not logged in, either login or create an account to post comments
posted by steinsaltz at 3:20 PM on November 12, 2012