Loading ...
Sorry, an error occurred while loading the content.

Pagination with consecutive dataTables

Expand Messages
  • chad.clites
    The title is a bit misleading, but I couldn t come up with a good title. In short, I am displaying saved biological data based on user selection. Users can
    Message 1 of 2 , Jun 30, 2009
    • 0 Attachment
      The title is a bit misleading, but I couldn't come up with a good title. In short, I am displaying saved biological data based on user selection. Users can save data sets, and via a menu selection, display those results.

      When the user views the first data set, pagination works perfectly. If the user then clicks on the menu to view another saved data set, the pagination no longer works. By not working, I mean that it doesn't appear that the datatable is being created as a paginated table. There are no options to page forward or backward through the table.

      I am using the code from here with only minor modifications:
      http://developer.yahoo.com/yui/examples/datatable/dt_dynamicdata.html

      A new datatable object is created each time a user requests to display a different data source. I have traced through the code, and the execution path is identical each time a data source is selected. Does anybody else have any suggestions as to what I may be have overlooked?

      The only thing that remains the same from set to set is myConfigs, which of course is what sets up the pagination.
    • Lucas Smith
      ... Be sure you have handleDataReturnPayload specified for each DT you are creating. If you create one DT and just update the DataSource via sendRequest, be
      Message 2 of 2 , Jul 2, 2009
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "chad.clites" <cclites@...> wrote:
        >
        > The title is a bit misleading, but I couldn't come up with a good title. In short, I am displaying saved biological data based on user selection. Users can save data sets, and via a menu selection, display those results.
        >
        > When the user views the first data set, pagination works perfectly. If the user then clicks on the menu to view another saved data set, the pagination no longer works. By not working, I mean that it doesn't appear that the datatable is being created as a paginated table. There are no options to page forward or backward through the table.
        >
        > I am using the code from here with only minor modifications:
        > http://developer.yahoo.com/yui/examples/datatable/dt_dynamicdata.html
        >
        > A new datatable object is created each time a user requests to display a different data source. I have traced through the code, and the execution path is identical each time a data source is selected. Does anybody else have any suggestions as to what I may be have overlooked?
        >
        > The only thing that remains the same from set to set is myConfigs, which of course is what sets up the pagination.
        >

        Be sure you have handleDataReturnPayload specified for each DT you are creating.

        If you create one DT and just update the DataSource via sendRequest, be sure to send the 'argument' property in the callback object or default the payload object received by the handleDataReturnPayload function:
        myDataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
        oPayload = oPayload || {};
        oPayload.totalRecords = oResponse.meta.totalRecords;
        return oPayload;
        }

        If this doesn't help, please send a code snippet or, better yet, a link to a simplified repro case.

        Luke
      Your message has been successfully submitted and would be delivered to recipients shortly.