EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: evaj on November 07, 2012, 04:39:46 AM



Title: Editable DataGrid
Post by: evaj on November 07, 2012, 04:39:46 AM
Hello,
I'm using a Editable DataGrid, but when the cell is a numeric type, I can't paste the information in other numeric cell type, please could you help me?

You can see it in the section 'Live Demo', I would like paste the information of the cell 'List Price' in the cell 'Unit Cost'
http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=
Row Editing DataGrid


Thanks
Regards


Title: Re: Editable DataGrid
Post by: stworthy on November 07, 2012, 05:19:13 AM
The paste operation is not allowed on numberbox. To enable the pasting feature, rebind the 'paste' event on numberbox after calling 'beginEdit'.
Code:
$('#dg').datagrid({
onClickRow:function(index){
$(this).datagrid('beginEdit',index);
var ed = $(this).datagrid('getEditor',{index:index,field:'unitcost'}); // get numberbox editor
$(ed.target).unbind('paste.numberbox').bind('paste',function(){
return true;
});
}
});


Title: Re: Editable DataGrid
Post by: evaj on November 07, 2012, 08:06:14 AM
Thank you very much