Html Grid
Bind to the cellclick event by type: jqxGrid.
Author: http://jqwidgets.com
HTML
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="https://jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/generatedata.js"></script>
<div id="grid">
</div>
<div style="margin-top: 20px;">
<input style="margin-top: 10px;" id="filterbox"/>
<div style="margin-top: 10px;">
<input type="button" id="applyfilter" value="Apply Filter" />
<input type="button" id="clearfilter" value="Clear Filter" />
</div>
</div>
JavaScript
var data = generatedata(200);
var source =
{
localdata: data,
datafields:
[
{ name: 'firstname', type: 'string' },
{ name: 'lastname', type: 'string' },
{ name: 'productname', type: 'string' },
{ name: 'date', type: 'date' },
{ name: 'quantity', type: 'number' },
{ name: 'price', type: 'number' }
],
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source);
// create grid.
$("#grid").jqxGrid(
{
width: 600,
source: dataAdapter,
filterable: false,
sortable: true,
autoshowfiltericon: false,
columns: [
{ text: 'First Name', datafield: 'firstname', width: 100 },
{ text: 'Last Name', datafield: 'lastname', width: 100 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Order Date', datafield: 'date', width: 100, cellsformat: 'd' },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 100, cellsalign: 'right', cellsformat: 'c2' }
]
});
// create buttons, listbox and the columns chooser dropdownlist.
$("#applyfilter").jqxButton({});
$("#clearfilter").jqxButton({});
$("#filterbox").jqxInput({ width: 180, height: 25 });
// builds and applies the filter.
var applyFilter = function () {
$("#grid").jqxGrid('clearfilters');
var filtertype = 'stringfilter';
var filtergroup = new $.jqx.filter();
...