Chat GPT-generated DataTables Configs – Helpful or Risky in Production?
Chat GPT-generated DataTables Configs – Helpful or Risky in Production?

Hi all,
I’ve been experimenting with using ChatGPT to generate more complex DataTables configurations – for example combining serverSide
, rowGroup
, responsive
, and buttons
. It often gives me a working base really fast, especially when I don’t want to comb through the docs for every option.
But I’ve noticed something: sometimes it uses outdated syntax, or omits edge-case settings that cause issues when used in production (like incorrect ajax
structure, or missing columns.render
functions when needed).
So I'm curious:
- Has anyone here tried using ChatGPT (or other LLMs) to generate or validate their DataTables setup?
- Do you trust those outputs in production code?
- Are there particular config areas where AI-generated code tends to fail or mislead?
Would love to hear your experiences — especially if you've seen ChatGPT give bad advice that looked fine at first glance.
Thanks!
Replies
I know plenty of people are using it to help them configure their DataTables config, so yes, without question there are people out there using such code in production.
The flip side is that I've also seen questions where it has generated nonsense - there was one case where someone insisted a method must exist because ChatGPT said it did (it didn't and never had).
It is a tool like any other - you need to understand it and its limitations. If you use it to generate code, personally, I think that it then needs to be reviewed so that you understand what it is doing, and why it is doing it.
It is somewhat ironic that humans are ending up code reviewing computer generated code...
.
Allan
Thanks, @Allan – totally agree.
I’ve also seen ChatGPT generate code that looks reasonable at first glance but breaks when you actually try to combine features like rowGroup with serverSide or when using custom rendering callbacks. It’s definitely helpful as a starting point, but as you said – you really need to understand and review what it’s doing.
I like your point about humans reviewing AI-generated code – it’s funny but also kind of necessary right now.
have you seen any particular recurring mistakes that AI tends to make when generating DataTables config?
No patterns that I can really think of I'm afraid. I'll ponder that further and post back if I think of any.
Allan
I just wanted to chime in here and speak from an amateur's perspective on what ChatGPT was able to help me build in about an hour, which would have taken me personally much longer and probably still not have quite had the features I added to this (such as the ordering).
I wanted to create a Feature plugin that would create filter buttons for the table based on the data.
I wanted to pass options to it in one of two ways:
Or
Below is what it produced after starting with some basic direction, a basic outline of the code, and nine prompts in total, a couple of which were to allow the passage of just a string and a couple more to add the ordering capability.
Aside from providing the initial skeleton code, the only change I made was to create the classNames object.
The code is functional although I haven't run it through the ringer and I do not claim it's as good as what a professional could do.
However, a couple of things I noticed, which seem to be common occurrences when I use ChatGPT for programming:
- It occasionally gets mixed up between DataTables 1.x and 2.x. Even after a reminder, it sometimes wanders back to the wrong version.
- I have had the same experience Allan mentioned where it referred to methods the API does not have or it has the wrong parameters, etc.
- Don't assume any piece of code that is currently working will be left alone in a subsequent version, even if you didn't ask anything about that specific part. Some of the changes are for the better and some are not, but either way don't assume it won't be changed.
- It might not remember anything you've asked about before. For example, I had a previous chat about the layout, but I had to provide a code sample of what the layout looked like since it was initially writing this plugin to produce the wrong output.
- It does a much better job than I personally do at error trapping and other such programming basics. I almost always program as though data is going to be passed along perfectly in the format that I'm expecting, but ChatGPT often builds little checks for null or undefined or whatever that I wouldn't necessarily think about or take time to address until I have an actual issue with my website.
Overall, as an amateur ChatGPT has been great for me albeit not perfect.
I can see why professional programmers are both worried and not worried. It advances me along in ways I wouldn't have been able to do as easily but I can also easily spot some things it runs afoul with.
Anyway, the final code for my filterButton feature plugin is below for anyone's review and critique (and improvement!).
Also note I told it to build the doc comment, which is a step I almost always skip in practice!
Occurred to me I should add a picture of the final product.
Also I should note that I did not initially ask for the "All" button, ChatGPT just included it, but I liked it so I kept it.
That's another observation -- sometimes it will offer me something I hadn't even thought of.
Awesome! It's great to get some first hand feedback
Allan
@Loren Maxwell Ich weiß das wirklich zu schätzen. Es ist so klar.