gpt4 book ai didi

angular - AgGrid 中的对象复制粘贴不起作用

转载 作者:行者123 更新时间:2023-12-03 08:54:34 24 4
gpt4 key购买 nike

  1. 我创建了 AgGrid 数据表,其中 AgGrid Cell 包含自定义对象
  2. 该对象具有名称、颜色、锁定等属性。
  3. 我正在使用 customCellRenderer 和 customCellEditor
  4. 现在我必须将一个单元格数据复制到其他单元格数据。

我尝试了AgGrid公开的以下方法

 processCellFromClipboard = function(params) {
console.log(params.value);
return params.value;}

processCellForClipboard = function(params) {
console.log(params.data);
return params.value;
};

FromClpboard 方法正在提供对象,但我无法在 processCellFromCliboard 中查看相同的 View 。有没有其他方法可以实现自定义对象的复制粘贴。任何想法或示例都会有帮助吗?

Currently evaulating AgGrid enterprise edition for the copy paste feasibility of custom objects.

最佳答案

// Copy and paste for objects is possible via the code below.
// Add these handlers to the gridOptions.

processCellFromClipboard: function(params) {
return JSON.parse(params.value);
}

/**Method which copies for clipboard
* Method takes params which is given from agGrid
* Have to stringify the object as it will take only string
*/

processCellForClipboard: function(params) {
return JSON.stringify(params.value);
}

关于angular - AgGrid 中的对象复制粘贴不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56547383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com