Html Grid
Set the filterable property of the jqxGrid.
Author: http://jqwidgets.com
HTML
<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>
<script src="http://www.iinnsoft.com/jqx-all.js"></script>
<div id="grid"></div>
JavaScript
var data = generatedata(200);
var source =
{
localdata: data,
datatype: "array",
updaterow: function (rowid, rowdata, commit) {
alert(args.owner.element.id);
console.log(args);
commit(true);
},
datafields:
[
{ name: 'firstname', type: 'string' },
{ name: 'lastname', type: 'string' },
{ name: 'productname', type: 'string' },
{ name: 'available', type: 'bool' },
{ name: 'quantity', type: 'number' },
{ name: 'price', type: 'number' }
]
};
var dataAdapter = new $.jqx.dataAdapter(source);
// initialize jqxGrid
$("#grid").jqxGrid(
{
width: '100%',
source: dataAdapter,
editable: true,
selectionmode: 'singlecell',
editmode: 'click',
columns: [
{ text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 },
{ text: 'Last Name', datafield: 'lastname', width: 90 },
{ text: 'Product', datafield: 'productname' },
{ text: 'Quantity', datafield: 'quantity', width: 70, cellsalign: 'right' },
{ text: 'Available', datafield: 'available', columntype: 'checkbox', width: 67 }
]
});
alert("please edit grid");