-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] Implement Clipboard import #199
Comments
Bidirectional compatibility with Excel clipboard data is desired. That is copy from Excel, paste in the data grid and vice versa. |
Would love to see the ability to copy a particular cell or entire column to clipboard. |
We have recently done an iteration in #1929. What we seem we still have to do on what we have already built (ignoring what's we could build next):
|
Would love to see the ability to copy a particular cell or entire column to clipboard. |
Would love to see copy prioritized over paste. |
We would love this too! Both copy and paste! |
Would be real nice |
I'd love to use this feature, both copy and paste as well! |
This would be a massive upgrade to data grid |
@oliviertassinari do you anticipate that this feature will have full copy and paste functionality across multiple selected cells? This would be similar to: https://ag-grid.com/javascript-data-grid/clipboard/ that you mentioned in the benchmark? |
/ Is there any way to pay to have this implemented sooner? |
upvote for feature. |
Is this going to be released. Anyone can recommend a library that has this feature? Thanks |
This comment was marked as resolved.
This comment was marked as resolved.
Any update on this feature? |
updates? |
You can check out the preview of the feature in #7389 |
Hi, will this be included in the community version or the closed-source one? |
@FlorianCassayre Clipboard import is a Premium feature and will not be included in the Community plan |
I have a raw solution in case anyone is interested. https://gist.github.com/gotexis/34ed4ba97317303acb233e4cbb035725 |
Quick and dirty "copy table to clipboard" js: <button id="copyButton">Copy to Clipboard</button>
<script>
function copyToClipboard(text) {
const textarea = document.createElement("textarea");
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand("copy");
document.body.removeChild(textarea);
}
function getTableData() {
const rows = document.querySelectorAll(".MuiDataGrid-row");
let data = "";
rows.forEach((row) => {
const cells = row.querySelectorAll(".MuiDataGrid-cellContent");
cells.forEach((cell, index) => {
data += cell.textContent;
if (index < cells.length - 1) data += "\t";
});
data += "\n";
});
return data;
}
document.getElementById("copyButton").addEventListener("click", () => {
const tableData = getTableData();
copyToClipboard(tableData);
alert("Data copied to clipboard");
});
</script> |
The link to the docs for this feature: https://mui.com/x/react-data-grid/clipboard/#clipboard-paste. It was released in v6.4.0 https://github.com/mui/mui-x/releases/tag/v6.4.0 |
@oliviertassinari It's not explicitly stated in the docs, but is Clipboard Copy a Premium-only feature? |
@dep It's open source per https://mui.com/pricing/ However, I agree with you, it's confusing, a new issue #9725 |
I do see that it is indeed a Community / Pro feature, thanks! Unfortunately when I try to use
Desired result: Actual result: |
It almost looks like, from here that selecting cells is a premium-only feature:
|
@dep Ah yes, it's the same thing, fixed in mui/material-ui#38029. |
Summary
Copy and paste data between an Excel sheet and a Data Grid.
Benchmark
The text was updated successfully, but these errors were encountered: