Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / my jquery table plugin

Author
Message
Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Nov 2019 06:19
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 do?

- Build from the DOM or json
- Pagination
- filtering
- custom rendering
- sorting
- 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.
http://zimnox.com/ztable/


I still have a few things to finish up before I officially release it.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2020-04-03 06:35:45
Your offset time is: 2020-04-03 06:35:45