Keep showing 10 entries when clicking more than 10 entries

Keep showing 10 entries when clicking more than 10 entries

vyrelivyreli Posts: 3Questions: 1Answers: 0

Hello, i want to ask a question,
is there a way to keep showing 10 entries when clicking show more than 10 entries in datatables ?
for example clicking 15 entries but still has a pagination with 10 entries and 5 without showing all 15 entries at the same time in datatables.
Thanks in advanced.

Answers

  • kthorngrenkthorngren Posts: 20,264Questions: 26Answers: 4,764

    Thats not a builtin capability of Datatables. You might be able to create your own pager to do this. Maybe you can describe more about your goal and environment, like are you using server side processing?

    Kevin

  • vyrelivyreli Posts: 3Questions: 1Answers: 0

    hello kevin,i am not using server side processing, i just wanna ask if there is a way to do that because it might be useful for me in the future. and could you tell me how i can make my own pager in datatables ? thank you

  • kthorngrenkthorngren Posts: 20,264Questions: 26Answers: 4,764

    I still don't understand what you are trying to achieve. If you select a page length of 15 rows but only want to display 10 of them what happens to the other 5? Are you looking for a way to scroll, like this example?

    Kevin

  • vyrelivyreli Posts: 3Questions: 1Answers: 0

    like in this example https://datatables.net/ if you click on show 25 entries on that table it will show 25 rows but i want to achieve is i want the rows still showing 10 rows not 25 rows even if you click show 25 entries.

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    I'm not sure why you would want to do that - wouldn't you just not show the page length component? What's the use case for that?

    Colin

  • kthorngrenkthorngren Posts: 20,264Questions: 26Answers: 4,764

    Maybe you don't want to show the page length selection. You can remove it using the lengthChange option or dom option.

    Kevin

This discussion has been closed.