admin管理员组文章数量:1426648
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 badges1 Answer
Reset to default 6I 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()
本文标签: javascriptJquery DataTablestrigger show all entriesStack Overflow
版权声明:本文标题:javascript - Jquery DataTables - trigger show all entries - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745443834a2658569.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论