Hey,
i have buttons like 'select all', 'deselect all', 'invert selection' but i want these buttons to only work on the visible part of the tables, so after filtering and paging.
How do i do this?
Maikel
Maybe something this will work in your button config:
exportOptions: { rows: ':visible' }
Kevin
what i currently have:
select: { info: true, style: 'os', selector: 'td:not(:has(div.details-control), .details-control), th' },
i tried adding :visible in there but it doesn not seem to work
You'll need a custom button to do what you are looking for. Something like:
{ text: "Select visible", action: function ( dt ) { dt.rows( { page: 'current' } ).select(); } }
What Kevin was looking at was when exporting data with buttons such as excel.
excel
Allan
I had to modify allans code to get it to work. I'm not a javascript expert but maybe it will help someone.
{ text: "Select Page", action: function ( e, dt, button, config ) { dt.rows( { page: 'current' } ).select(); } },
Doh! I forgot about the e parameter. Thanks for pointing that out.
e
Thnx eJed. It works like magic
Can you provide full example?
@Jatin : here you go,
Colin
Replies
Maybe something this will work in your button config:
Kevin
what i currently have:
i tried adding :visible in there but it doesn not seem to work
You'll need a custom button to do what you are looking for. Something like:
What Kevin was looking at was when exporting data with buttons such as
excel.Allan
I had to modify allans code to get it to work. I'm not a javascript expert but maybe it will help someone.
Doh! I forgot about the
eparameter. Thanks for pointing that out.Allan
Thnx eJed. It works like magic
Can you provide full example?
@Jatin : here you go,
Colin