Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I'm working with angular-datatables.

My end goal is to have a table with no pagination but with a "link" that allow to "show 25 more entries" (and without using the select length "10", "25", "50","100" etc).

So first of all, I set the display length to 25 with :

this.dtOptions = DTOptionsBuilder.newOptions()
    .withBootstrap()
    .withDisplayLength(25)

Great my table is showing only 25 five entries with pagination. No I try to disable the pagination with :

this.dtOptions = DTOptionsBuilder.newOptions()
   .withBootstrap()
   .withDisplayLength(25)
   .withOption('paging', false)

And then the pagination is disable but the table is showing more than 25 entries.
I get that it's kind of logic since otherwise there will be no means to acces those 25+ entries but that's what i'd liked to acheive.

Thanks

share|improve this question
up vote 1 down vote accepted

I would simply hide the injected pagination element when the table is finished rendering :

.withOption('drawCallback', function() {
   $('.dataTables_paginate').hide()
})

.dataTables_paginate is the overall <div> where dataTables places the pagination control, if any.

share|improve this answer
1  
I didn't think of the simpliest solution ! In the same principe I just hide in the css the .dataTables_paginate – Antt Nov 21 '16 at 12:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.