JSFiddle - React, Tailwind, and code Playground
by cilex
HTML
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<div id="jqxgrid">
</div>
<div style="margin-top: 30px;">
<input type="button" id="saveState" value="Save State" />
<input type="button" id="loadState" value="Load State" />
</div>
JavaScript
var data = [];
var source =
{
localdata: data,
datafields:
[
{ name: 'name', type: 'string' },
{ name: 'productname', type: 'string' },
{ name: 'available', type: 'bool' },
{ name: 'date', type: 'date'},
{ name: 'quantity', type: 'number' }
],
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source);
$("#jqxgrid").jqxGrid(
{
width: "100%",
source: dataAdapter,
columnsresize: true,
columnsreorder: true,
showfilterrow: true,
pageable: true,
pagesize: 15,
pagesizeoptions: ['15', '30', '50', 200],
virtualmode: true,
rendergridrows: function (params) {
return params.data;
},
groupable: true,
filterable: true,
selectionmode: 'checkbox',
columns: [
{ text: 'Name', columntype: 'textbox', filtertype: 'input', datafield: 'name', width: 215 },
{
text: 'Product', filtertype: 'checkedlist', datafield: 'productname', width: 220
},
{ text: 'Available', datafield: 'available', columntype: 'checkbox', filtertype: 'bool', width: 67 },
{ text: 'Ship Date', datafield: 'date', filtertype: 'range', width: 210, cellsalign: 'right', cellsformat: 'd' },
{ text: 'Qty.', datafield: 'quantity', filtertype: 'number', cellsalign: 'right' }
]
});
$("#saveState").jqxButton({ });
$("#loadState").jqxButton({ });
var state = null;
$("#saveState").click(function () {
// save the current state...