Skip to content

Commit

Permalink
core: add onsort method binded to cliek event from table header
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Oct 15, 2012
1 parent 91f7b90 commit c7a78b1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions index.js
Expand Up @@ -92,10 +92,24 @@ DataTable.prototype.header = function(cols){
o('<th>').append(el.text(isstr ? c : c[0])).appendTo(this.el.find('thead tr'));
}

// set colspan in footer element
this.el.find('tfoot tr td').attr('colspan', cols.length);

this.el.on('click', 'thead a', this.onsort.bind(this));
return this;
};

/**
* Bind `click` event in table header
*
* @param {Object} ev jQuery object event
* @api public
*/

DataTable.prototype.onsort = function(ev){
ev.preventDefault();
};

/**
* Render the table body
*
Expand Down

0 comments on commit c7a78b1

Please sign in to comment.