jQuery EasyUI DataGrid Filter Row showColumn hideColumn
HTML
<div class="easyui-panel" style="width:90%; height:350px; padding:6px;">
<div class="easyui-layout" data-options="fit:true">
<div data-options="region:'center', border:false">
Click on the following button to view a list of products in an edatagrid.<p />
<a id="btnWaveDetailsAddServer" href="#" class="easyui-linkbutton" onclick="javascript:showDGInWindow();" style="margin-left: 50px;margin-top: 50px;" data-options="iconCls:'icon-edit', plain:false">Show Edatagrid in Window</a>
</div>
</div>
</div>
<div id="myDgWin" class="easyui-window" data-options="width:550,height:270,iconCls:'icon-add',modal:true,closed:true,minimizable: false,maximizable: false,collapsible: false">
<table id="dg"></table>
</div>
CSS
</style> <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css"> <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.js"></script> <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script> <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.edatagrid.js"></script> <script type="text/javascript" src="http://www.jeasyui.com/easyui/datagrid-filter.js"></script> <style>
JavaScript
$(function() {
var dg = $('#dg').edatagrid();
dg.edatagrid({
title: "Test DataGrid",
fit: true,
pagination: true,
singleSelect: true,
striped: true,
rownumbers: true,
fitColumns: false,
data: data,
columns: [[
{field: 'productid', width: 100, title: 'Product',
editor: { type: 'textbox' }
},
{field: 'listprice', width: 100, align: 'right', title: 'List Price',
editor: { type: 'combobox' }
},
{field: 'status', width: 100, align: 'center', title: 'Status' }
]]
});
});
function showDGInWindow() {
$('#myDgWin').window('open');
}
var data = [{
"productid": "FI-SW-01",
"productname": "Koi",
"unitcost": 10.00,
"status": "P",
"listprice": 36.50,
"attr1": "Large",
"itemid": "EST-1"
}, {
"productid": "AV-CB-01",
"productname": "Amazon Parrot",
"unitcost": 92.00,
"status": "N",
"listprice": 63.50,
"attr1": "Adult Male",
"itemid": "EST-18"
}];