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 745179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:03:53+00:00 2026-05-14T09:03:53+00:00

I don’t understand what I’m doing wrong here ! I keep getting a Data

  • 0

I don’t understand what I’m doing wrong here ! I keep getting a Data Error. But I validated the JSON and it’s ok…

Here is the javascript from the YUI Datatble example (slightly modified).



<pre class="prettyprint"><code>

<script type="text/javascript">
YAHOO.util.Event.addListener(window, "load", function() {
    //var Ex = YAHOO.namespace('example');

    var dataSource = new YAHOO.util.DataSource("jsondb/json_meta_proxy.html",{
        responseType : YAHOO.util.DataSource.TYPE_JSON,
        responseSchema : {
            resultsList: "records",
            fields: [
                            {key:"idprojet"},
                            {key:"nomprojet"}
                    ],
                    metaFields: { 
                    totalRecords: "totalRecords"
                    }
        },
        doBeforeCallback : function (req,raw,res,cb) {
            // This is the filter function
            var data     = res.results || [],
                filtered = [],
                i,l;

            if (req) {
                req = req.toLowerCase();
                for (i = 0, l = data.length; i < l; ++i) {
                    if (!data[i].state.toLowerCase().indexOf(req)) {
                        filtered.push(data[i]);
                    }
                }
                res.results = filtered;
            }

            return res;
        }
    });

    var cols = [
        {key:"idprojet"},
            {key:"nomprojet"}
    ];

    var paginateur = new YAHOO.widget.Paginator({
        rowsPerPage   : 25,
        pageLinks     : 10
    });

    var conf = {
        paginator : paginateur,
        sortedBy: {key:'idprojet', dir:YAHOO.widget.DataTable.CLASS_ASC}
    };

    var dataTable = new YAHOO.widget.DataTable('tbl',cols,dataSource,conf);

    var filterTimeout = null;
    var updateFilter  = function () {
        // Reset timeout
        filterTimeout = null;

        // Reset sort
        var state = dataTable.getState();
            state.sortedBy = {key:'idprojet', dir:YAHOO.widget.DataTable.CLASS_ASC};

        // Get filtered data
        dataSource.sendRequest(YAHOO.util.Dom.get('filter').value,{
            success : dataTable.onDataReturnInitializeTable,
            failure : dataTable.onDataReturnInitializeTable,
            scope   : dataTable,
            argument: idprojet
        });
    };

    YAHOO.util.Event.on('filter','keyup',function (e) {
        clearTimeout(filterTimeout);
        setTimeout(updateFilter,600);
    });
});
</script>

and here is the JSON data in the file “jsondb/json_meta_proxy.html”



    {
    "recordsReturned": 1,
    "totalRecords": 1,
    "startIndex": 0,
    "sort": "idprojet",
    "dir": "asc",
    "records": [
        {
            "idprojet": "11256",
            "nomprojet": ""
        }
    ]
}

Many thanks for your help !!!

  • 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-14T09:03:53+00:00Added an answer on May 14, 2026 at 9:03 am

    If you don’t get an answer on StackOverflow, you may want to try posting your question to the YUI developer forums: http://yuilibrary.com/forum. Many YUI experts, including the most experienced DataTable developers, hang out there.

    -Eric

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

Sidebar

Related Questions

Don't know what's wrong here, when I run the application it says Specified method
Don't know where else to ask, but from one day to the other my
Don't ask why, but is there any way to suppress a failed linking error?
Don't know what to do with this error. How to add data in SQL
Don't know if it's I'm doing it wrong or if there's a bug (I
Don't get me wrong, I want them to get saved. But I always thought
don't understand: in my controller: @json = User.all.to_gmaps4rails do |user| \Title\: \#{user.email}\ end in
Don't understand, if Data.Map is and [] is. I found this out while wondering
Don't get me wrong - I love Smalltalk, but... To me, the Squeak interface
don't know better title for this, but here's my code. I have class user

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.