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

Re: Problem with sorting tables and pagination

Expand Messages
  • modernbluedesign
    ... http://developer.yahoo.com/yui/examples/datatable/dt_server_pag_sort.html ... 1-15 of ...
    Message 1 of 4 , Sep 26, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "Lucas Smith" <lsmith@...> wrote:
      >
      > --- In ydn-javascript@yahoogroups.com, "mingfai.ma" <mingfai.ma@>
      > wrote:
      > >
      > > --- In ydn-javascript@yahoogroups.com, "modernbluedesign"
      > > <patrick@> wrote:
      > > >
      > > > Even in this yahoo example,
      > > >
      > >
      >
      http://developer.yahoo.com/yui/examples/datatable/dt_server_pag_sort.html
      > > > it shows on top of the table "showing 0 - 14 of 1397".
      > > >
      > > > I think that's a bit confusing, and would rather have it say
      "1-15 of
      > > > 1397".
      > > >
      > > > Anybody have experience with this?
      > > >
      > > > I appreciate any help you can offer.
      > > >
      > >
      > > I think it doesn't make sense, too. Just tried to set the {startIndex}
      > > to {startIndex+1} for pageReportTemplate but it doesn't work as the
      > > startIndex is a template. What's the easiest way to make it 1-15?
      > >
      > > pageReportTemplate : "Showing items {startIndex} - {endIndex} of
      > > {totalRecords}"
      > >
      >
      > You can configure what is shown in the CurrentPageReport component by
      > setting the pageReportTemplate, using the variables provided by the
      > pageReportValueGenerator. The default pageReportValueGenerator offers
      > the following values:
      > * currentPage
      > * totalPages
      > * startIndex
      > * endIndex
      > * startRecord (this is what you're looking for)
      > * endRecord (and this)
      > * totalRecords
      >
      >
      http://developer.yahoo.com/yui/docs/YAHOO.widget.Paginator.ui.CurrentPageReport.html#config_pageReportTemplate
      >
      > Hope this helps,
      > Luke
      >

      Luke, that is exactly what I needed. All I had to do was replace this:

      pageReportTemplate : "Showing items {startIndex} - {endIndex} of
      {totalRecords}

      with this:

      pageReportTemplate : "Showing items {startRecord} - {endRecord} of
      {totalRecords}

      Thanks for the help!
      Patrick
    Your message has been successfully submitted and would be delivered to recipients shortly.