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

Re: Problem with server-side pagination

Expand Messages
  • jimsearle
    I received an email response to this, and a few others have emailed asking for the solution, so I ll post it here. I removed the senders name in case he
    Message 1 of 3 , Oct 10, 2008
    • 0 Attachment
      I received an email response to this, and a few others have emailed
      asking for the solution, so I'll post it here. I removed the senders
      name in case he didn't want it posted here, but I'd gladly give him
      credit since it solved my problem!

      Also, check out my post:
      http://tech.groups.yahoo.com/group/ydn-javascript/messages/39019?threaded=1&m=e&var=1&tidx=1
      Which has a complete example.

      - Jim

      ------------------------------------------------------------------

      Jim,

      The payload is part of the sendRequest callback. You're using the
      deprecated signature. Have a look at
      http://developer.yahoo.com/yui/docs/YAHOO.util.DataSourceBase.html#method_sendRequest

      var callback = {
      success : myDataTable.onDataReturnInitializeTable,
      scope : myDataTable,
      argument : myDataTable.getState()
      };
      myDataTable.getDataSource().sendRequest(newRequest,callback);

      The argument key in the callback contains the payload. If you are
      changing the data state, you might want to return to page 1. In which
      case, you'll want to modify the payload before it's passed:

      var state = myDataTable.getState();
      state.pagination.recordOffset = 0;

      var callback = {
      success : myDataTable.onDataReturnInitializeTable,
      scope : myDataTable,
      argument : state
      };
      ...

      Since you're pointing to onDataReturnInitializeTable, the state
      modification is probably unnecessary, tho.

      Hope this helps,
    Your message has been successfully submitted and would be delivered to recipients shortly.