Skip to content
Browse files

arrows when 'sortbyme' is a string

  • Loading branch information...
1 parent 6208e4c commit a7e2969dbcfe5631ee0f35b0cd54953a2e6491a8 @reconbot committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 bts-table.js
View
7 bts-table.js
@@ -189,7 +189,6 @@
sortBy: function(col){
if(!this.opt.sortable){return;}
if(typeof this.collection.sortBy !== 'function'){throw new Error("Collection isn't a SortableList");}
- this.sortField = col;
//TODO some magic to check the col array for a sorting function
this.collection.sortBy(col);
},
@@ -202,6 +201,12 @@
},
updateArrows: function(){
+ if(typeof this.collection.sortByMe === 'string'){
+ this.sortField = this.collection.sortByMe;
+ }else{
+ this.sortField = '';
+ }
+
var field = this.sortField;
this.$('.js-sort-sprite').removeClass('icon-arrow-down icon-arrow-up');
var sprite = this.$('th[data-field="'+ field +'"] > .js-sort-sprite');

0 comments on commit a7e2969

Please sign in to comment.
Something went wrong with that request. Please try again.