list.js icon indicating copy to clipboard operation
list.js copied to clipboard

Custom page classes for pagination

Open cdekkers opened this issue 6 years ago • 7 comments

Love the library! However, I was surprised to find no option for easily adding custom class attributes to a pagination item for styling purposes, e.g. instead of using only the default classes:

<ul class="pagination">
    <li class="active">
        <a class="page" href="...">1</a>
    </li>
    ...
</ul>

I wanted to add some Bootstrap class names:

<ul class="pagination">
    <li class="page-item active">
        <a class="page-link page" href="...">1</a>
    </li>
    ...
</ul>

This could be achieved by allowing tweaks to the following line in pagination.js: https://github.com/javve/list.js/blob/52afe2db0d018df3009acf49b6cbb56943b28024/src/pagination.js#L85 This could, for example, be achieved by adding two new options during list initialization, similar to the paginationClass option.

cdekkers avatar Jul 31 '19 12:07 cdekkers

Hey @javve! 👋

I found myself in the same situation as @cdekkers. I want to change the styling of the pagination and I'm not able to do so with the current version.

I saw that there's multiple PR that should solve this issue. May I help somewhere to get this feature in your library?

RomainLanz avatar Sep 02 '19 08:09 RomainLanz

Having the same issue here. Does anyone start working on that? I can help!

fccoelho7 avatar Nov 07 '19 12:11 fccoelho7

Hey @fccoelho7!

I made a fork that allow me to use Bootstrap styling. It's not perfect because you cannot customize the styling, but it's working for my use-case.

RomainLanz avatar Nov 07 '19 14:11 RomainLanz

Hey, is there any update to this issue? I need also to add custom classes to <li>. Which file should I edit in order to add it manually?

messalas avatar Jun 01 '20 09:06 messalas

Update?

samuelbushi avatar Apr 18 '21 17:04 samuelbushi

update ?

ehsanwwe avatar Jan 19 '22 11:01 ehsanwwe

https://github.com/javve/list.js/issues/744#issuecomment-1086039470 I hopes it can help :)

EvilDTX91 avatar Apr 01 '22 15:04 EvilDTX91