EasyUI Forum
September 14, 2025, 02:33:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Editable DataGrid  (Read 11311 times)
evaj
Newbie
*
Posts: 13


View Profile Email
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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;
});
}
});
Logged
evaj
Newbie
*
Posts: 13


View Profile Email
« Reply #2 on: November 07, 2012, 08:06:14 AM »

Thank you very much
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!