Can i setting the length of page on datatable

Can i setting the length of page on datatable

ironcastironcast Posts: 4Questions: 0Answers: 0

Here my picture, i want to limit the number of showing on pagination because it is make over width on my page, but i got difficult, anyone can help me?

How to setting it?

Replies

  • kthorngrenkthorngren Posts: 21,352Questions: 26Answers: 4,955

    You can set the pagingType. There are also some paging plugins you can look at.

    Kevin

  • ironcastironcast Posts: 4Questions: 0Answers: 0

    Thank you for helping, but i still got the problem that the output for simple_numbers , full_numbers , first_last_numbers the amount of number is same, i dont find that the pagingType can limit the amount of number

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Yep, those types would still display the same number of buttons, but as Kevin said, you can create your own paging plugin to show less. What exactly do you want? No buttons? A fixed amount but less?

    Colin

  • ironcastironcast Posts: 4Questions: 0Answers: 0

    ohh i see "create your own paging plugin to show less" i should learn it first, what i want is like first|current-1|current page|current+1|last

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    That sounds a lot like pagingType: "full", only with words and not numbers - see example here.

    Colin

  • kthorngrenkthorngren Posts: 21,352Questions: 26Answers: 4,955

    Maybe the ellipses paging plugin will be close. Looks like it has a setting where you can define how many page numbers to show:

    $.fn.dataTableExt.oPagination.ellipses = {
        'oDefaults': {
            'iShowPages': 5
        },
    

    Kevin

  • ironcastironcast Posts: 4Questions: 0Answers: 0

    Thank you so much mr Kevin and mr colin, the problem has been solved, thank you for helping my duty :)

Sign In or Register to comment.