javascript - Jquery DataTables - trigger show all entries - Stack Overflow

I would like to know if there is a function which can expand an entire Datatable. I don't mean to

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

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

Share Improve this question asked Sep 20, 2016 at 20:12 Noam HackerNoam Hacker 4,84510 gold badges36 silver badges57 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 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()

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745443835a4627953.html

相关推荐

  • javascript - Jquery DataTables - trigger show all entries - Stack Overflow

    I would like to know if there is a function which can expand an entire Datatable. I don't mean to

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信