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

  • Home
  • SEARCH
  • 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 3675584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:59:39+00:00 2026-05-19T02:59:39+00:00

I am trying to fill a Datatable with a JSON using YUI, I have

  • 0

I am trying to fill a Datatable with a JSON using YUI,

I have this JSON:

[{"test":"value1",
"test2":"value2",
"test3":"value3",
"topic_id":"123139007E57",
"gmt_timestamp":1553994442,
"timestamp_diff":-1292784933382,
"status":"images\/statusUp.png",
"device_id":"568FDE9CC7275FA"}, ..

It continues like this with about 20 different devices, and I close it with a ]

I just want to print select keys in the datatable so my Column Definitions look like this:

var myColumnDefs = [
    {key:"test", sortable:true, resizeable:true},
    {key:"test2", sortable:true, resizeable:true},
    {key:"topic_id", sortable:true, resizeable:true},
    {key:"status", sortable:true, resizeable:true},
    {key:"device_id", sortable:true, resizeable:true},
];

var myDataSource = new YAHOO.util.DataSource(bookorders);
        myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
        myDataSource.responseSchema = {
            fields: ["test","test2","topic_id","status","device_id"]
        };


    var myDataTable = new YAHOO.widget.DataTable("basic",
            myColumnDefs, myDataSource);

It’s print Data Error for some reason, what am I doing wrong?

Thanks!

I have tested the validity of the JSON at JSONLint and it says it is valid.

  • 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-05-19T02:59:40+00:00Added an answer on May 19, 2026 at 2:59 am

    If you’re using JSON, I think your datasource response type should be of that type: YAHOO.util.DataSource.TYPE_JSON instead of TYPE_JSARRAY. Have you looked at the example in: developer.yahoo.com/yui/examples/datatable/dt_xhrjson.html

    Can you use Firebug to see exactly which is the error? See if the response is OK and which json is returned. If you think its a problem of the json you can use a library like Jackson to generate it in the server (it will make sure that the json returned is ok).

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

Sidebar

Related Questions

I am trying to fill my datatable using LINQ expression below , this works
I'm trying to load a CSV into a DataTable using this: class CSVReader {
I'm trying to fill my datatable using their own api, and well it doesn't
I am trying to fill a table with JSON data. When I run the
I am trying to do a TableAdapter.Fill(dataTable) and it fails with the above error.
I am trying to read datas from an uploaded xls. I have used this
I'm trying to create a jsf datatable with select one menu and to fill
Which one is more faster between DataTable and SqlDataReader while I'm trying to fill
I have been trying to use OleDbDataAdapter to update a DataTable but got confused
I have a combo box and I populated it this way: DataTable dt =

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.