Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82248

Generator Packages not working - Uncaught Cannot extend unknown button type: selected datatables.min

$
0
0

https://live.datatables.net/subeqajo/1/edit?html,css,js,console,output:
Debugger code onovex:
Uncaught Cannot extend unknown button type: selected datatables.min.js:32:
Description of problem: - Same issue as second example

https://live.datatables.net/talidili/1/edit?html,css,js,console,output
Debugger code apolaz:
Uncaught Cannot extend unknown button type: selected datatables.min.js:32:

Description of problem:

Hi! My apologies in advance as I am a coding noob that is trying to develop a web app. I accidently found the world of datatables last week and I instantly recognized this is a MUST HAVE for me due to my app relying heavily on a back-end database and the need to display & edit data to users. I purchased the Developer License on Monday for the editor but have been racking my brains for DAYS now just to achieve my datatables Hello World moment...

My humble goal is to simply get a simple table displayed on the screen (just four columns) that is editable connected to a simple table within my MySQL database. My plan is to then use this as a template of sorts for the CDNs on the front end I commonly use and the backend for database connectivity.

When I found your code generator I figured this would be stupid simple - https://editor.datatables.net/generator/index. Not so much several days later now...

Using the software selector I first chose the DataTables styling framework, jQuery 3, Moment, DataTables, Editor,Buttons, & DateTime. I then selected PHP, MySQL and entered the information for my Form / Table, etc & hit the Download Package button. I also did a secondary config using Bootstrap 5 I would test for a second round.

Next I deleted everything in the www directory of my dev webserver, unzipped the package, edited the config file with my database info, and entered the frontend HTML filename into the browser. The page loaded with the table column names but no date. When I opened the dev console the network tab loaded all of the files fine and I had a single error in the Console tab - Uncaught Cannot extend unknown button type: selected datatables.min.js:32: No data was returned to the screen I then cleared everything out and then dropped in my second zip containing the Bootstrap 5 version. same result. I did some modifications to turn off the edit functionality and could easily get the data to display on the screen so the back-end connection is confirmed to work.

This is when I went down the rabbit hole(s) with ChatGPT dring to do a deep dive into the issue doing everything I could do debug the code.

The Generator created this standard section in my js file;


layout: {
topStart: {
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor }


Doing a pause at uncaught sections in the Sources tab led me to this piece of code in datatables.min.js


var n, o, i = this, s = this.s.dt;
for (e = t(e); e && e.extend; ) {
if (!w[e.extend])
throw "Cannot extend unknown button type: " + e.extend;


So what seems to be going on is the layout section in the .js file is trying to define what buttons the editor will use but for some reason the datatables.min.js isn't happy thinking a button is "unknown" which causes the table not to initalize explaining why its halting before any data is shown on the screen.

Same behavior for the DataTables version of style framework as well as the Bootstrap 5 version.

Next chapter......

I then started trying all kinds of combinations with the generator picking different things to see if I could make some combo work. Some way somehow in a middle of the night moment of muted victory I got this autogenerated version to work

https://live.datatables.net/qojosuna/1/edit?html,css,js,console,output
Your debug code is: inirot

Don't ask me how or why but for the life of me (and ChatGPT) I can't figure out the difference and I am unable to replicate my success which brings me back to my first point - I just want to be able to use the code generator to bang out a table with the addons I want and it just work when I drop it down onto my clean dev server so I can modify the frontend for the specific cosmetics of the page I am working on. I need to be able to make this repeatable and reliable.

I am new to all of this and just noticed 2.x was just released a couple of weeks ago. Bugs maybe with the generator or the code? This generator thing is an awesome / killer feature and the way it works is the zip file should just work with nothing to do but update the config file with creds. Right?

Thanks in advance for any help.

Domenic


Viewing all articles
Browse latest Browse all 82248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>