code-and-effect / effective_datatables

An effective ActiveRecord to Datatables dsl for Ruby on Rails. Make intelligent tables quickly.
MIT License
133 stars 36 forks source link

buttons_export_columns not working in input_js #149

Closed rainyhuynh closed 3 years ago

rainyhuynh commented 3 years ago

I want to authorize or not user access Print, Copy, Export Excel buttons.

I try render_datatable(@datatable, input_js: { buttons_export_columns: ':visible:not(.col-actions)' }) but not working.

Can you tell me how to limit that?

Thank you. Rainy.

matt-riemer commented 3 years ago

Hey,

I'm not totally sure what's not working. I know passing that selector does work

Here's the effective_datatables code where the custom JS is passed

https://github.com/code-and-effect/effective_datatables/blob/master/app/assets/javascripts/effective_datatables/initialize.js.coffee#L5

And here are the front end docs for those html5 buttons:

https://datatables.net/extensions/buttons/examples/html5/simple.html

rainyhuynh commented 3 years ago

Hi Matt,

Thank you for your information, let me try.