Datatables and Joomla

Datatables and Joomla

buildcratebuildcrate Posts: 5Questions: 0Answers: 0
edited March 2011 in General
Can someone teach me how put Datatables on my Joomla website. I will pay the one who offers the solution

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited March 2011
    You just need to put in an HTML table which looks something like this:
    http://datatables.net/usage/#prerequisites

    Then include the JS file for jQuery and DataTables (and the CSS if you want it)

    [code]

    @import "/media/css/demo_page.css";
    @import "/media/css/demo_table.css";



    [/code]
    Then finally initialise DataTables:

    [code]

    $(document).ready(function() {
    $('#example').dataTable();
    } );

    [/code]
    Allan
  • buildcratebuildcrate Posts: 5Questions: 0Answers: 0
    ok I have created a simple HTML table, but I don't know how to put the JS files in Joomla.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Nor do I :-). I've not used Joomla before - I'd suggest asking in a Joomla forum.

    Regards,
    Allan
  • buildcratebuildcrate Posts: 5Questions: 0Answers: 0
    I have been able to put jquery in joomla. Then how do I put js files in jquery?
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You don't - you put them into the HTML like what I put above. It is possible to load JS files via jQuery (or just general Javascript) but that requires inserting your on Javascript as well - and I don't know how you do that in Joomla.

    Allan
  • buildcratebuildcrate Posts: 5Questions: 0Answers: 0
    there is my basic table. Where do I add everything else?




    ARTIST
    TITLE
    BPM
    CLEAN
    DIRTY
    INTRO
    DOWNLOAD


    71
    NAME
    TITLE
    C
    D
    I
    NAME


    82
    NAME
    TITLE
    C
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The Javascript includes and the document ready function should be added (typically) in the HTML HEAD element. Have a look at this example (view source): http://datatables.net/examples/basic_init/zero_config.html . How you put that information into the header in Joomla - I honestly couldn't say :-)

    Allan
  • jwebdesjwebdes Posts: 2Questions: 0Answers: 0
    edited March 2011
    buildcrate, you need to install the module called "Sourcerer". It allows you to place code directly into your articles (without it the joomla text editors will strip your code). You need to get your code working outside of joomla before trying to insert it into an article.
    The module is free and you can get it here: http://extensions.joomla.org/search?q=Sourcerer
  • daveddpdaveddp Posts: 4Questions: 0Answers: 0
    hi buildcrate if you still need the solution, know that i found it and actually this works in my model normally... So are you really wanna paie for it or it was only a joke
This discussion has been closed.