6
nitnip
6y

JQuery DataTable is awesome when you just want to show a nice table without doing anything else.

As soon as you want to customize behavior it's hellish. My productivity slows to a crawl because of all unpredictable behavior and non-helpful errors.

Last one was something like $.f is undefined in console, all because I made a footer with a colspan bigger than the table.

Fuck this (Whatever 'this' is at the moment, probably undefined).

Comments
  • 0
    @Charon92 completely 100% unrelated to what our boy here is ranting about. Not that its bad advice. But he is mentioning Datatables.js for a reason.
  • 1
    Dude its a major pain in the ass to do any level of customization in that motherfucker. Speeeecially if you are dealing with populating data from an xml or json api.

    By heavens that shit is absolute hell. Once you get it working its the tits tho. Will look for a React or Vue alternative. It just might be easier man.
  • 0
    @AleCx04 it is not different though. The datatable has a default implementation difficult to change.
    With css grid you can make your own implementation which is build from the ground up to do what you want.

    Yes you can change an office building to live there but isnt it more comfortable to live in a house which has all your needs?
  • 0
    I stopped using it because it sucks. Using vue good table and loving it so far.
  • 1
    I went through hell trying to configure it as well. Simple functionalities like single or multi row selection require sophisticated code to be written.
  • 1
    @Codex404 That's the point of datatables. To not have to make your own. Datatables brings a lot of functionality, which is maybe their downfall but ultimately the best shit. If you can show me that I can make a fully working table with searching, reordering in CSS tables in 4 lines, then hell I'll believe you. But I guess that's not what css tables are about.
  • 0
    @Subtixx the point is that OP has to overwrite things because datatables is not what he needs. That costs ton of work. And can break things after an update. Building it yourself gives you full control.

    If it is what you need then sure use it, but if its not then please write your own.
  • 1
    @Codex404 It's more extending than overriding. Well... basically it's just a million callbacks. There is some unexpected shit like having to download the language json files because browsers sometimes block the ajax request. And a lot of having to guess what's wrong since errors aren't always helpful.

    The only parts I do override are the default export buttons.

    Printable content is fine and all but it doesn't take into account the callbacks I made to customize the table so it's worthless as is. The pdf, csv and xls exports.... I'd rather do them in the backend.
  • 0
    @nitnip well same same, replace my overwriting words for extending and voila
  • 0
    @Codex404 datatables is huge as it is man and building your own is akin to reinventing the wheel. The thing which makes it complex is that it takes a while to learn it. Its similar to learning a framework. But once you are done with it it can be all you need. Datatables is really huge.
Add Comment