<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">
<b>Using column dropdown filter</b>
<br>
<br>Run this until first row starts with a "T32" or "T1111" username
<br>- filter type = string
<br>
<br>Then run until a numeric entry shows and the 1st row of the column
<br>- filter type = numeric or date (<em>incorrect</em>)
<br><br>
<div id='usersfound'></div>
JavaScript
// prepare the data
var data = new Array();
var userNames = [
1122, "T1111", 10000, 'T32'];
var classType = [
"A", "B", "C", 'D'];
for (var i = 0; i < 500; i++) {
var row = {};
row["available"] = false;
row["Username"] = userNames[Math.floor(Math.random() * userNames.length)];
row["Classtype"] = classType[Math.floor(Math.random() * classType.length)];
data[i] = row;
}
var source = {
localdata: data,
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) {},
loadError: function (xhr, status, error) {}
});
$("#usersfound").jqxGrid({
source: dataAdapter,
filterable: true,
columns: [{
columntype: "checkbox",
datafield: "available",
name: "checkbox",
editable: false,
sortable: true,
groupable: true,
columnsresize: true,
filterable: true,
width: 40
}, {
columntype: "text",
text: "User",
width: 120,
datafield: "Username",
editable: false,
hidden: false
}, {
columntype: "text",
text: "Class Type",
width: 120,
datafield: "Classtype",
editable: false,
hidden: false
}]
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.