DataTable not initilializing

DataTable not initilializing

zgoforthzgoforth Posts: 473Questions: 87Answers: 2
edited August 20 in DataTables 1.10

Link to test case: https://jsfiddle.net/BeerusDev/5nLg4bt0/25/

Hello, I am starting a new project and plan on using DataTables again. I initialized the table and I get the following errors:

"jQuery.Deferred exception: Cannot read property 'sWidth' of undefined", "TypeError: Cannot read property 'sWidth' of undefined

"Script error."

I created a sample dataSet to populate the table with and I have never seen this error before out of all the times I have used DataTables.

I also get warnings in my column initialization . "Duplicate key: data" Why is this?

I have the same amount of columns in my data/column init. as my HTML table.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 13,816Questions: 25Answers: 3,252
    edited August 20 Answer ✓

    The main problem is you have columns defined with one object not individual objects for each column. See this example. Fixing this might fix the Cannot read property 'sWidth' of undefined error.

    I have the same amount of columns in my data/column init. as my HTML table.

    Nope... you are defining only one column in columns :wink:

    Kevin

  • zgoforthzgoforth Posts: 473Questions: 87Answers: 2
    edited August 20

    I am such an idiot haha, thank you Kevin! I forgot to wrap the columns respectfully with brackets..

    @kthorngren one more thing, why won't bootstrap load? I tried concatenating the CDN files and that screwed everything up so I have them all individual and it still isn't recognizing bootstrap??

    https://jsfiddle.net/BeerusDev/5nLg4bt0/39/

Sign In or Register to comment.