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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:10:25+00:00 2026-05-14T01:10:25+00:00

I have a YUI DataTable (YUI 2.8.0r4) with AJAX pagination. Each row in the

  • 0

I have a YUI DataTable (YUI 2.8.0r4) with AJAX pagination. Each row in the table links to a details/editing page and I want to link from that details page back to the list page that includes the record from the details page. So I have to a) offset the AJAX data correctly and b) tell YAHOO.widget.Paginator which page to select.

According to my reading of the YUI API docs, I have to pass in the initialPage configuration option. I’ve attempted this, but it doesn’t take (the data from AJAX is correctly offset, but the paginator thinks I’m on page 1, so clicking “next” takes me from e.g. page 6 to page 2.

What am I not doing (or doing wrong)?

Here’s my DataTable building code:

(function() {
  var columns = [
    {key: "retailer",    label: "Retailer",    sortable: false, width: 80},
    {key: "publisher",   label: "Publisher",   sortable: false, width: 300},
    {key: "description", label: "Description", sortable: false, width: 300}
  ];

  var source = new YAHOO.util.DataSource("/sales_data.json?");
  source.responseType = YAHOO.util.DataSource.TYPE_JSON;
  source.responseSchema = {
    resultsList: "records",
    fields: [
      {key: "url"},
      {key: "retailer"},
      {key: "publisher"},
      {key: "description"}
    ],
    metaFields: { totalRecords: "totalRecords" }
  };

  var LoadingDT = function(div, cols, src, opts) {
    LoadingDT.superclass.constructor.call(
      this, div, cols, src, opts);
    // hide the message tbody
    this._elMsgTbody.style.display = "none";
  };
  YAHOO.extend(LoadingDT, YAHOO.widget.DataTable, {
    showTableMessage: function(msg) { 
      $('sales_table_overlay').clonePosition($('sales_table').down('table')).
        show();
    },
    hideTableMessage: function() { 
      $('sales_table_overlay').hide();
    }
  });

  var table = new LoadingDT("sales_table", columns, source, {
    initialRequest: "startIndex=125&results=25",
    dynamicData: true,
    paginator: new YAHOO.widget.Paginator({rowsPerPage: 25, initialPage: 6})
  });

  table.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
    oPayload.totalRecords = oResponse.meta.totalRecords;
    return oPayload;
  };
})();
  • 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-14T01:10:25+00:00Added an answer on May 14, 2026 at 1:10 am

    If you want to initialize the Paginator to a different page, you also need to provide a (temporary) value for totalRecords. This forum thread provides more detail:

    http://yuilibrary.com/forum/viewtopic.php?f=90&t=1913&start=0&hilit=initialPage

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

Sidebar

Related Questions

I use yui datatable in my asp.net application... I have a link button in
I want to have a seekbar(like int the link: YUI Library Examples ) with
I have some javascript I want to do post-render for a YUI datatable, but
I have a DataTable in YUI and I want to have the record ID
Question for YUI experts... I have a table and I've made each cell of
I use yui datatable and i have a field which is resumePath which is
I have the following jsfiddle that generates a YUI Datatable with checkboxes, but i
I have implemented column resizing with YUIs DataTable as demonstrated in this example: http://developer.yahoo.com/yui/examples/datatable/dt_complex_clean.html
I have been playing with server side sorting/paging using YUI DataTable, and everything is
I have a DataTable and DataSource (YUI 2.6). The XHRDataSource connects to an XML

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.