JQuery DropDownList
Set the checkboxes property of the jqxDropDownButton.
Author: http://jqwidgets.com
Author: http://jqwidgets.com
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/generatedata.js"></script>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div style="float: left">
<div>Choose Column:</div>
<div id="columnchooser"></div>
<div style="margin-top: 10px;" id="filterbox"></div>
<div style="margin-top: 10px; visibility:hidden;">
<input type="button" id="applyfilter" value="Apply Filter" />
<input type="button" id="clearfilter" value="Clear Filter" />
</div>
</div>
<div style="margin-left: 20px; float: left" id="jqxgrid">
</div>
</div>
</body>
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.
$("#jqxgrid").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").jqxDropDownList({ checkboxes: true, width: 200, height: 34 });
// updates the listbox with unique records depending on the selected column.
var updateFilterBox = function (datafield) {
var filterBoxAdapter = new $.jqx.dataAdapter(source,
{
...