Skip to content

Renumber ordered list during pagination #787

@tliron

Description

@tliron

It seems that List.js does not renumber ordered lists during pagination.

I would imagine that it would be a common need, if not most common! Perhaps we can enable it with an option?

Happily, the implementation is very easy and can be done right now, though it does refer to an undocumented property, i. Example:

  new List("catalog", {
    valueNames: ['title'],
    page: 50,
    pagination: {
      innerWindow: 20,
      outerWindow: 20
    }
  })
  .on("updated", (list) => list.list.setAttribute("start", list.i));
});

And the HTML:

<div id="catalog">
    <input class="search" type="search" placeholder="Search..." size="50">
    <ul class="pagination"></ul>
    <ol class="list">
      ...
    </ol>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions