tableFilter

This plugin started out as a test project. I’m not a classically trained programmer so this was an experiment to understand how objects and oop work. At the moment, there is very little configurability, but that’s coming. Given a relatively simple table, the plugin should be able to figure out how to deal with it.

For now, here is what we have to work with:

Usage: $(’yourtable’).tableFilter([ tableOptions (Object) ])

  • tableOptions (optional) These options are global for the table.
    • stripeClass: default = “offColor”. The CSS class you want to use for striping the table rows.
    • pageLength: default = “25″. The number of rows per page.
    • paging: default = true. Paginate table.
    • sort: default = true. Toggle sorting.
    • sortOnLoad: default = 0. Default column to sort when loading table.
    • decimalPlaces: default = 2. Number of decimal places for numeric columns.
    • loadPlugins: default = false. Load plugins. This can be enabled in the main menu currently.
    • showDebug: default = false. Show debug information in the javascript console- this will go away eventually.
    • imagePath: default = “images/icons”. Location of the various images.

Example:

Text only
  1.    $('#tableID').tableFilter();
Highlighting by GeSHI

Tips:

  • Use thead and tfoot blocks to clearly delineate headers and footers if tableFilter doesn’t seem to understand your structure.
  • Huge tables are always going to be a problem in IE - they have major issues with their CSS engine, so every operation involves overhead. I found a hack that works for smaller tables, but your mileage may vary.
  • Please continue to suggest improvements :)

You can find the demo here: http://ideamill.synaptrixgroup.com/jquery/tablefilter/tabletest.htm

Zip file with source code, images, css and support files: http://ideamill.synaptrixgroup.com/jquery/tablefilter/tablefilter.zip