Cannot read property 'length' of undefined - JQuery Datatables Plugins

Posted on 2015-01-26
Last Modified: 2015-07-06
I'm trying to make it Jquery Datatables plugins work by fetching fetching data while I'm doing that I'm getting the following error,

Anybody points me what is causing this error to be happen?
"Cannot read property 'length' of undefined - JQuery Datatables Plugins"

*! DataTables 1.10.2 */

Question by:nisarkhan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 44

Accepted Solution

Rainer Jeschor earned 500 total points
ID: 40571210
two issues:
- in the HTML the data-name for the third column should be
<th data-name="CompanyLegalName" data-width="160">Name</th>

Open in new window

(name typo: LegalCompanyName <> CompanyLegalName)
- the JSON is not the configured format - you configured the data inside the results property of the JSON object. Therefore if you add on top of your data.json a
and at the end the closing }
then it works.

Author Closing Comment

ID: 40571725
Perfect, Thank you.

Expert Comment

ID: 40869267
How would you just do this with jquery not NG? Like the example on . http://localhost:8888/Datatables/examples/data_sources/ajax.html
I am not having luck with that..locationsdash.html

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question