cgee
cgee

Reputation: 1887

.tableSorterPager is not a function

I getting the following error:

.tableSorterPager is not a function. 

I can't find my mistake in the following code:

    <script type="text/javascript">
$(function() {
    $("table")
        .tableSorter({widthFixed: true, widgets: ['zebra']})
        .tableSorterPager({container: $("#pager")});
});
</script>

Upvotes: 4

Views: 3774

Answers (1)

just.another.programmer
just.another.programmer

Reputation: 8785

The error means the tableSorterPager plugin was not initialized before you called it.

Possible reasons:

  1. You forgot to include the tableSorter.pager.js file in your page (<script type="text/javascript" src="/path/to/jquery.tablesorter.pager.js"></script>). tableSorter pager is a separte plugin to tableSorter.
  2. You included tableSorter.js after you made the call to it. Don't forget, javascript is evaluated in the order it appears on the page
  3. You have a namespace conflict between two plugins

Upvotes: 4

Related Questions