jQuery: using several items together like order, language...

jQuery: using several items together like order, language...

thowithowi Posts: 67Questions: 7Answers: 0

Hi all together,

DataTables works extremely nice, but I am completely new to all jQuery / javascript ... please be so kind and take a short look at line 136 and 138.
I terminated those lines with "," because I thought it is a good idea. But the table won't work when doing that. Also ";" or simply no termination will crash the table.
The functions all alone will work perfectly, but of course I would like to use order, language and footerCallback all together..

I would be happy if you could take a look:
https://pastebin.com/ATBvQrf1

Thank you so much!
Tom

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736

    In your browser's console you should see a syntax error and it should point to the line. You are missing a comma in the language option:

            "language": {
                "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json",
                "decimal": ",",
                "thousands": "."  <<< need comma here
                "lengthMenu": "Zeige _MENU_ Ergebnisse pro Seite",
                "zeroRecords": "Nix gefunden - sorry",
                "info": "Zeige Seite _PAGE_ von _PAGES_",
                "infoEmpty": "Keine Daten vorhanden",
                "infoFiltered": "(gefiltert aus insg. _MAX_ Ergebnissen)"
            },
    

    I took a glance at the rest but didn't see anything that stands out.

    Kevin

  • thowithowi Posts: 67Questions: 7Answers: 0

    Oh man, thats kind of embarrassing :D Thank you Kevin!
    But also after adding the "," - die Table doesn't work.

    The table is missing many features like sort icons, total calculation and so on...
    Looking like that on my screen: https://dropbox.com/s/uifhik136sni92b/datatables.jpg?dl=0

    Any ideas? Must have something to do with the enumeration of methods like language, order, footerCallback etc...

    Mh :/

  • kthorngrenkthorngren Posts: 20,141Questions: 26Answers: 4,736

    Do you get any errors (alerts or browser console)?

    Kevin

  • thowithowi Posts: 67Questions: 7Answers: 0
    edited August 2018

    Yes, but without any deep knowledge of jQuery / javascript it is not very helpful for me :/
    Maybe you have an idea where the problem is?
    https://www.dropbox.com/s/26ny1smudn14apc/error.jpg?dl=0

    Currently the site is public viewable under stats.valonic.com

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @thowi ,

    You're missing a function declaration - if you look in the console, you'll see an error: "(index):156 Uncaught ReferenceError: intVal is not defined". I assume you can just grab it from this example here.

    Cheers,

    Colin

  • thowithowi Posts: 67Questions: 7Answers: 0

    Hi Colin,

    thank you for your patience and help. Works now :)

    Enjoy your evening!

This discussion has been closed.