KeyTable plugin handling of empty tables

KeyTable plugin handling of empty tables

dvilaverdedvilaverde Posts: 7Questions: 0Answers: 0
edited December 2009 in Plug-ins
Does the KeyTable plugin handle datatables that have zero rows? I keep getting an error about 'nTr' undefined.

Replies

  • fthomasfthomas Posts: 8Questions: 0Answers: 0
    Forgive my ignorace, but wouldn't you want to handle an empty table return with a jquery element or just a php conditional statement that displays a message like, 'no results found'? This would look better and eliminate complications.
  • dvilaverdedvilaverde Posts: 7Questions: 0Answers: 0
    That's what I ended up doing, but I just figured KeyTable would handle an the empty table without throwing unhandled exceptions. It's my first time using keytable and it took me a while to figure out that the error was because of the empty table and not because I was using it incorrectly.
  • fthomasfthomas Posts: 8Questions: 0Answers: 0
    Hmm. I know what you are saying. I've since started to use KeyTables and its a great plugin, but pretty lean on documentation. There is quickie how to's but I had to disect an example page with javascript turned off to figure out how to format my tables to allow KeyTables to modify them.

    Not bulking, this jQuery addition is saving me weeks of frustration and work!

    Frank
  • dvilaverdedvilaverde Posts: 7Questions: 0Answers: 0
    Agreed, it a great plugin and am glad I found it. It just takes a bit of searching to figure out how to do anything beyond the examples.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi guys,

    Thanks for the heads up about this dvilaverde. I've put a fix for this into the 1.1.0 release of KeyTable, which you can download from here: http://www.sprymedia.co.uk/software/KeyTable/KeyTable.zip (note that this is actually a release of 1.1.0, with a minor change in the package from what I posted yesterday).

    Also, I agree, the documentation for KeyTable isn't really up to the standard set by DataTables, but there is some: http://www.sprymedia.co.uk/article/KeyTable . I've also beefed this up a little with with the 1.1.0 release to describe and provider examples for the new events handling and the API functions.

    Hope this helps,
    Allan
This discussion has been closed.