Restriction on no of column export
Restriction on no of column export
@nuj_3313
Posts: 15Questions: 5Answers: 0
Hi all,
Is there a way to restrict the user to export the n no of columns.
Basically i want to do this for pdf exports to protect the page layout. I know there is other way to set the page sizes but it will be good if i can restrict to n no of columns and show a message. I can have 100's of columns in the table so.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
See if this thread asking a similar question helps.
Kevin
No... that is different requirement.
My requirement is to force user to hide some column using colvis button while exporting to pdf if trying to export more than n no of columns.
Please help
Here are some ideas:
You can use the
column-visibility
event to determine if the number of visible columns, usingcolumns().visible()
, is good for export. You could usebutton().enable()
andbutton().disable()
based on the number of visible columns.You can use
buttons.buttons.action
to determine the number of visible columns, usingcolumns().visible()
, and execute the export if the number is good. See the third example in thebuttons.buttons.action
docs.There are probably other ways you can combine these to meet your requirements.
Kevin
Got it Thanks @kthorngren
I have used
buttons.buttons.action
and jquery to get the no of column like below