在AgGrid中复制对象的粘贴项不起作用
问题描述:
- 我已经创建了一个AgGrid数据表,其中AgGrid单元包含一个自定义对象
- 该对象具有一些属性,例如名称,颜色,锁定等.
- 我正在使用customCellRenderer和customCellEditor
- 现在,我不得不将一个单元格数据复制到其他单元格数据中.
我尝试了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);
};