Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8669301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:26:25+00:00 2026-06-12T18:26:25+00:00

I am trying to populate a dataTable as follows: $(#my-datatable).dataTable( { sAjaxSource : /someURLOnMyServer,

  • 0

I am trying to populate a dataTable as follows:

$("#my-datatable").dataTable( {
    "sAjaxSource" : "/someURLOnMyServer",
    "bDestroy" : true,
    "fnServerParams" : function(serverParams) {
        serverParams.push(
            {
                "name" : "widget",
                "value" : token
            }
        );
    }
});

And the HTML table it is populating:

<table id="my-datatable">
    <thead>
        <tr>
            <th>Type</th>
            <th>Value</th>
            <th>ID</th>
            <th>Fizz</th>
            <th>Buzz</th>
        </tr>
    </thead>
    <tbody></tbody>
</table>

According to Firebug, the JSON coming back from the server is:

[
   {
      "id":1,
      "attributeType":{
         "id":1,
         "name":"test1",
         "tag":"test-type",
         "is-dog":false
      },
      "attributeValue":{
         "id":null,
         "name":"blah",
         "tag":"BLAH"
      },
      "buzz":1,
      "fizz":"53abc"
   }
]

But Firebug is throwing the following JavaScript error in its console:

TypeError: aData is undefined
[Break On This Error]   

for ( i=0 ; i<aData.length ; i++ ) --> jquery.dataTables.js (line 2541)

Can anyone spot what’s going wrong? Either I’m not setting up my dataTable object correctly, or the JSON coming back doesn’t match the “schema” of the HTML table it is trying to populate. Either way, I’m lost. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:26:26+00:00Added an answer on June 12, 2026 at 6:26 pm

    Datatables requires a certain format for results. If you are not using that format, you have to declare everything.

    $('#my-datatable').dataTable( {
    
        "sAjaxSource": "/url/here",
    
    
        "fnServerData": function ( sSource, aoData, fnCallback ) {
                aoData.push( { "name": "widget", "value": "token" } );
    
                request = $.ajax({
                  "dataType": 'json', 
                  "type": "GET", 
                  "url": sSource, 
                  "data": aoData, 
                  "success": fnCallback
                });
          },
    
    
          "aoColumns": [
                { "mDataProp": "id"},
                { "mDataProp": "fizz"},
                { "mDataProp": "name"},
                { "mDataProp": "tag"},
                { "mDataProp": "tag"},
                { "mDataProp": "attributeValue.name"},
                { "mDataProp": "attributeValue.tag"},
            ],
    
        });
    

    This is the format: http://datatables.net/release-datatables/examples/server_side/post.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a DataTable to populate a DataGrid in VB.NET. The
I am trying to populate a List<Image> by reading the name of the each
I am trying to populate an array with the text value of a json
I'm trying to populate a DataTable, to build a LocalReport, using the following: MySqlCommand
Im trying to populate a JSF Datatable with data that I am retrieving from
I've been trying, unsuccessfully, to get a yui3 datatable to correctly populate via a
I am trying to populate a dataTable via a list. Essentially my app, submits
I'm trying to populate a List with a column of a DataTable in order
I have an collection of java beans that populate a JSF DataTable I'm trying
I am trying populate H3 with the sum of column E for rows that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.