DataTables and Wiki

DataTables and Wiki

WinterionWinterion Posts: 2Questions: 0Answers: 0
edited November 2009 in General
Good afternoon (and happy Turkey Day to everyone states-side!)

I've been trying to implement DataTables into a Mediawiki page, but have run into numerous issues. The first.. the implementation of scripts by putting them on the style's php page, I was able to find with some intensive Google work. However, when I read on Mediawiki's site that the software does not support and , and that I was getting an ugly error around line 4600-ish when trying to create a DataTable, I was losing hope that this most awesome jQuery plugin simply wouldn't be compatible with wikis.

Then, I ran into the forum discussion here on TravellersPoint (http://www.travellerspoint.com/guide/London/) and noticed.. hey, that's a wiki.. using DataTables! Hope renewed, I've been talking with Daamsey about how it was implemented. While I can't make heads or tails of the implementation from viewing source alone (short of some div usage), I am now confident I can somehow, someway, find a method to use DataTables in my wiki.

Does anyone else have experience in this? Is there a guide I might have overlooked? An existing extension? I'm all ears.

Appreciatively,
-Winterion

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Hi Winterion,

    As noted in the documentation ( http://datatables.net/usage/ ) DataTables requires a table formatted with tbody and thead, basically because this makes things a lot easier (it removes a huge amount of potential ambiguity). As such is a wiki's table support includes (or can be extended to) include these tags, DataTables will work no problem with it.

    Whatever wiki the TravellersPoint folks are using must have support for these tags - so there will certainly be wiki's out there which do allow it :-)

    Perhaps one option (for you are set on using MediaWiki) is to do some DOM "magic" before initialising DataTables :-). What you could do is to use 'createElement' and insert tbody and thead into the document, then move the rows around (first one into thead, the rest into tbody) and presto - you've got a table which DataTables can work with.

    Hope this helps,
    Allan
  • WinterionWinterion Posts: 2Questions: 0Answers: 0
    Hmm. I'll have to look into ways to do that. Thanks for your help!
This discussion has been closed.