JSFiddle - React, Tailwind, and code Playground
by Agus Sigit Wisnubroto
HTML
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/datagrid-groupview.js"></script>
<script src="http://www.jeasyui.com/easyui/jquery.edatagrid.js"></script>
<table id="dg1" title="Basic DataGrid (Double click to edit)" style="width:400px;height:150px"
data-options="
rownumbers:true,
singleSelect:true,
selectOnCheck:false,
checkOnSelect:false,
border:true,collapsible:true,
striped:true,
onLoadSuccess:function(data){
if(data.total == 0){
$(this).datagrid({collapsed:true});
}
},
onClickRow:onClickRow">
<thead>
<tr>
<th data-options="field:'itemid',width:80,editor:'text'">Item ID</th>
<th data-options="field:'productid',width:100,editor:'text'">Product</th>
<th data-options="field:'listprice',width:80,align:'right'">List Price</th>
<th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th>
</tr>
</thead>
</table>
<table id="dg2" title="Basic DataGrid (Double click to edit)" style="width:400px;height:150px"
data-options="
rownumbers:true,
singleSelect:true,
selectOnCheck:false,
checkOnSelect:false,
border:true,collapsible:true,
striped:true,
onLoadSuccess:function(data){
if(data.total == 0){
$(this).datagrid({collapsed:true});
}
},
onClickRow:onClickRow2">
<thead>
<tr>
<th data-options="field:'itemid',width:80,editor:'text'">Item ID</th>
<th data-options="field:'productid',width:100,editor:'text'">Product</th>
<th...
JavaScript
var data = {"total":28,"rows":[
{"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"},
{"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"},
{"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}
]};
$('#dg1').edatagrid({data:data});
$('#dg2').edatagrid({data:data});