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

Re: how to reset paginator

Expand Messages
  • cc_fo
    Disregard, the issue was only tangentially related to this (incorrect use of paginationRecordOffset...) ... paginator,
    Message 1 of 5 , Aug 22, 2008
    • 0 Attachment
      Disregard, the issue was only tangentially related to this (incorrect
      use of paginationRecordOffset...)

      --- In ydn-javascript@yahoogroups.com, "cc_fo" <cc_fo@...> wrote:
      >
      > I'm having trouble overriding the initializeTable method in the way
      > you described below - I stripped the part about the paginator out so
      > the function body was
      > "YAHOO.widget.DataTable.prototype.initializeTable.call(this);"
      >
      > but I get an error when my datasource fires its
      > onDataReturnInitializeTable event, from the datatable-beta.js
      > line 7652 - "oRecord is undefined".
      >
      > I'm using server-side pagination and basically the situation is this:
      > I can page through results no problem. Then, if I hit the "search"
      > button again I get the first page of results back - the correct
      > records are returned but the paginator doesn't reset so I have to page
      > back to the first page to see any results. Do I need to explicitly
      > implement some of the paginator's event handlers to cope with this?
      >
      > Chris
      >
      > --- In ydn-javascript@yahoogroups.com, "Lucas Smith" <lsmith@> wrote:
      > >
      > > --- In ydn-javascript@yahoogroups.com, WongTseng
      > > <wangzengverycool@> wrote:
      > > >
      > > > I've used datatable on a search panel, using pagination function.
      > > > When user closes the search panel, I want to clear all the data
      > > > received from the server, and the pagination links. I use the
      > > > deleteRecords method to remove all the records, but I can not clear
      > > > the pagination links. Even I call the destroy method on the
      paginator,
      > > > when the search panel is displayed again, the pagination links are
      > > > still there. How can I solve this problem?
      > > >
      > > > --
      > > > Thanks
      > > > Wong Tseng
      > > >
      > >
      > > You should be able to use the DataTable's initializeTable() method to
      > > clear all rows. Incidentally, there is a bug (omission, really)
      > > whereby initializeTable doesn't update the Paginator's totalRecords
      > > attribute. This is fixed in the upcoming 2.6 version. You can patch
      > > this via
      > > myDataTable.initializeTable = function () {
      > > this.get('paginator').set('totalRecords',0);
      > > YAHOO.widget.DataTable.prototype.initializeTable.call(this);
      > > };
      > >
      > > In your case, I would look at the Paginator's alwaysVisible attribute
      > > if you don't want to display pagination controls unless there is
      > > reason to.
      > >
      > > Hope this helps,
      > > Luke
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.