yarek
yarek

Reputation: 12054

how to limit number of rows when paging=false?

My goal is to display only 10 first rows in datatable.

I use : pageLength: 10 This works fine when paging = true

However I don't want to display the pagination either: When I put paging=false, there is no pagination but ALL rows are shown.

Upvotes: 1

Views: 995

Answers (1)

Bindrid
Bindrid

Reputation: 3735

Set paging to true, pageLength to 10 then add this to your table definition

   initComplete: function () {
              $("#example_paginate").css("display", "none");
           }

where "example" is replace by the name of your table. It worked in my local environment.

Upvotes: 2

Related Questions