Almost completed my first jQuery plugin. It takes a HTML table, and keeps the header fixed and also makes the columns sortable. Demo is located at http://tapmeister.com/test/sortfixedtable/index.html (click Create to initiate the plugin).
I’ve added a destroy() method which is intended to remove the plugin. Problem is it doesn’t remove the events.
On line 70 I add the event using something similar to:
$(this).on('click.sortfixedtable',methods.sortClick);
On line 151 I try to remove the event using something similar to:
$(this).off('.sortfixedtable');
The off() method, however, isn’t removing the click event. Can anyone show me where I am messing up. Thanks
You bind event handlers to
<th>elements, but try to remove it from the<table>element. Instead, remove it from the same<th>elements, which have the handler bound: