Is there any way to copy the data like copy to clipboard that comes out of box?

Answered
sudhasmsa asked on June 13, 2019

Hello,
We are using flexmonster pivot tables. Is there is any way to copy the data with an option like copy to clipboard instead of CTRL+C, CTRL+V ?
Could you please let me know?
 
Thank you

3 answers

Public
Vera Didenko Flexmonster June 14, 2019

Hello,
 
Thank you for your question.
 
We kindly recommend the following approach:
 
1) Specify the customizeContextMenu parameter to customize the context menu:

customizeContextMenu: customizeFlexmonsterContextMenu

2) Define the function responsible for the customization. For example, the copy option can be added to the context menu in the following way:

function customizeFlexmonsterContextMenu(items, data, viewType) {
items.push({
label: "Copy",
handler: function() {
console.log(">>>>", data);
//extract needed information and implement copy
}
});
return items;
}

Here is a JSFiddle example for illustration.
 
2) In the handler function, you can provide your implementation for copying the needed information.
 
Please let us know if this works for you.
 
Best Regards,
Vera

Public
sudhasmsa June 14, 2019

Hello Vera,
 
Thank you for the response. Sure, It allows me to access to data in multiple ways. I could have a external button and on click can do something like getData(options: {slice: {}}, callback). I was hoping the data that’s returned may be more like table structure. 
Thank you for the  prompt response.

Public
Vera Didenko Flexmonster June 17, 2019

Hello,

If you need to copy data like a table structure I can recommend you to try export data to CSV.
Does it meet your needs?

Regards,
  Vera

Please login or Register to Submit Answer