在AgGrid中复制对象的粘贴项不起作用 [英] Copy Paste of Object in AgGrid not working

查看:306
本文介绍了在AgGrid中复制对象的粘贴项不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

I have tried the below methods exposed by AgGrid

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

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

FromClpboard方法正在给对象,但是我无法在processCellFromCliboard中查看相同的视图.还有什么其他方法可以实现自定义对象的复制粘贴.任何想法或样本都会帮上忙吗?

The FromClpboard method is giving object but i am not able the view the same in processCellFromCliboard. Is there any other way i can implement the copy paste for the custom object. Any idea or sample will help up ?

当前正在评估AgGrid企业版的复制粘贴可行性自定义对象.

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

推荐答案

The object copy paste was possiable through adding below changes in implemented code as below : 

processCellFromClipboard = function(params) {
   return  JSON.parse(params.value);
 };
/**Method which copies for clipboard
* Method takes params which is given from agGrid
* Have to stringy the object has it will take only string

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

这篇关于在AgGrid中复制对象的粘贴项不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆