Hide export button for large tables
Hide export button for large tables
vitorleo80
Posts: 6Questions: 3Answers: 0
I'm trying to find a solution to hide an export CSV button if the table has more than 5000 rows. Someone could help? Thanks
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I would use table.rows().count()
https://datatables.net/reference/api/count()
https://datatables.net/reference/api/rows()
and use this event to do the counting:
https://datatables.net/reference/event/init
in the buttons part of your table definition you will have something like this:
And you'll have something like this, too.
Hi @vitorleo80 ,
The best place would be to call
button().remove()
ininitComplete
- you can get a row count withrows().count()
,Cheers,
Colin
Thanks for your help.
You are welcome! As you can see, many roads lead to Rome! Data tables is so flexible that I sometimes think it is too flexible ...