JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script src="http://www.jeasyui.com/easyui/jquery.edatagrid.js"></script>
<table id="dg" style="width:600px;height:200px"
title="Editable DataGrid"
singleSelect="true">
</table>
JavaScript
var data = [
{"productid":"p1","productname":"Product1","unitcost":10.00,"status":"P","listprice":16.50,"attr1":"Large","itemid":"EST-1"}
];
$(function(){
var dg = $('#dg');
dg.edatagrid({
columns:[[
{field:'itemid',title:'ItemID',width:100,editor:'text'},
{field:'listprice',title:'ListPrice',width:100,editor:'numberbox'},
{field:'unitcost',title:'UnitCost',width:100,editor:'numberbox'},
{field:'attr1',title:'Attribute',width:100,editor:'text'}
]],
data:data,
onBeginEdit:function(index){
var ed1 = $(this).edatagrid('getEditor',{index:index,field:'itemid'});
var ed2 = $(this).edatagrid('getEditor',{index:index,field:'listprice'});
var ed3 = $(this).edatagrid('getEditor',{index:index,field:'unitcost'});
var ed4 = $(this).edatagrid('getEditor',{index:index,field:'attr1'});
setKeydown([ed1.target,ed2.target,ed3.target,ed4.target]);
}
});
});
function setKeydown(tt){
for(var i=0; i<tt.length; i++){
var t = tt[i];
getInputBox(t).bind('keydown',{i:i},function(e){
if (e.keyCode == 13){
var next = getInputBox(tt[e.data.i+1]||tt[0]);
next.focus();
}
});
}
}
function getInputBox(target){
return $(target).data('textbox') ? $(target).textbox('textbox') : $(target);
}