jennschiffer / timbles.js

a very simple jQuery plugin for tables, made by the person who literally did not invent tables
MIT License
38 stars 4 forks source link

Calling enablePagination after init results in failure. #24

Closed edelooff closed 8 years ago

edelooff commented 8 years ago

When a table has been timblified (that is a word now) without pagination enabled in the initial setup, it's impossible to later enable pagination by calling tableElement.timble( 'enablePagination', 25 ).

The error thrown by the interpreter is Uncaught TypeError: Cannot set property 'recordsPerPage' of undefined. which is due to there being no pagination object in the plugin data. Enabling pagination after the fact is not a typical operation to do, but it should not fail like this.

It should be easy enough to alter enablePagination to add an pagination object to the data attribute if none exists. Tests for this should probably be added to the pagination test suite that's still on the ToDo list as well.