5

I would like to know if there is a function which can expand an entire Datatable. I don't mean to show all rows by default, but to switch from, for example, show 50 rows to show all rows (without having the user click the dropdown).

This is the kind of thing I am looking for:

var my_table = $('#my_table').DataTable()
my_table
    .rows(all) // the part I am unsure about!
    .draw()

Is there a way to do this? If not, I will have to simulate clicks with jquery

1 Answer 1

6

I found an answer on the datatables reference.

You must set the page dynamically with a length of -1

var my_table = $('#my_table').DataTable()
my_table
    .page.len(-1) // set the length to -1
    .draw()
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.