JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://www.jeasyui.com/easyui/jquery.min.js"></script>
<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">
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/demo/demo.css">
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/icon.css">
<title>Column Group - jQuery EasyUI Demo</title>
<body>
<h2>Column Group</h2>
<p>The header cells can be merged. Useful to group columns under a category.</p>
<div style="margin:20px 0;"></div>
<table id="dg" class="easyui-datagrid" title="Column Group" style="width:400px;height:250px" data-options="rownumbers:true,singleSelect:true,url:'datagrid_data1.json',method:'get',
toolbar:'#tb'">
<thead>
<tr>
<th id="itemTitle" colspan="2">Item Detailssss</th>
<th colspan="3">Item Details</th>
</tr>
<tr>
<th data-options="field:'itemid'">Item ID</th>
<th data-options="field:'productid', hidden:true">Product</th>
<th data-options="field:'unitcost',align:'right'">Unit Cost</th>
<th data-options="field:'listprice',align:'right'">List Price</th>
<th data-options="field:'attr1'">Attribute</th>
<th data-options="field:'status',align:'center'">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</tbody>
</table>
<div id='tb'>
<a href="#" id="showButton" class="easyui-linkbutton"...
JavaScript
var showProduct = true;
function showHideButton() {
if (showProduct) {
alert('show');
$('#dg').datagrid('showColumn', 'productid');
$('#itemTitle).attr('colspan ', 3);
showProduct = false;
} else {
alert('hide');
$('#dg').datagrid('hideColumn', 'productid');
$('#itemTitle).attr('colspan ', 2);
showProduct = true;
}
}