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>
<div id="tt" class="easyui-tabs" style="width:500px;height:250px;">
<div title="DATAGRID INSIDE TAB" style="padding:5px;">
<table id="dg" class="easyui-datagrid" title="WHEN INSERTING DATA IT WILL BE RENDERED ODDLY" style="width:500px;height:250px"
data-options="
fit:true,autoSizeColumn:true,
rownumbers:true,
singleSelect:true,
remoteSort:false,
border:true,
multiSort:true,
striped:true,
rowStyler: function(index,row){
if (row.ITEM_TYPE_FLAG == 'P'){
return 'background-color:#006F00;color:#FFFFFF;';
}
}">
<thead>
<tr>
<th data-options="field:'itemid',width:80">Item ID</th>
<th data-options="field:'productid',sortable:true">Product</th>
<th data-options="field:'listprice',sortable:true">List Price</th>
<th data-options="field:'unitcost',sortable:true">Unit Cost</th>
<th data-options="field:'attr1',sortable:true">Attribute</th>
<th data-options="field:'status',sortable:true">Status</th>
</tr>
</thead>
</table>
</div>
</div>
<button onClick="addData()">Insert Data</button>
<script>
function addData(){
$('#dg').datagrid('insertRow',{
index: 0,
row: {
itemid: 'Krueszack Lens',
productid: 30,
listprice: '132000',
unitcost: '200000',
attr1: 'None',
status: 'OK Go On, Long text Absolutely'
}
});
}
</script>