I decided to write a jquery plugin this week and I'm quite happy with it so far and felt the need to share. If you're familiar with datatables, it's kind of like that. If not, then it's a simple plugin that alters the table on your website to add additional functionality.
So what does ZTable
- Build from the DOM or json
- custom rendering
- column reordering
Some things I found easier to do than expected, like filtering. Moving columns, as expected, was tricky. And then there's pagination; which seemed simple at first but determining which page buttons to show when you have a lot of pages was a pain in the butt.
You can write your own custom column renderers, which passes the value of that cell, it's row and column number, and the data for the whole row. And you're not fixed to using the built-in controls, you can hide the ones you don't want by setting flags and write custom ones.
We use IE 11 for work, as does a lot more companies than you may realize. Because of this, I made sure the plugin works in IE11. Minified, the script comes in at 10kb.
Here's an example with 6 columns and 1k rows, loaded from a json source. This page uses bootstrap to make my table look pretty and some font-awesome icons in a few of the custom renderers.
I still have a few things to finish up before I officially release it.