JQXGrid Documentation
JQXGrid Documentation
jqxGrid
The Grid is a powerful jQuery widget that displays tabular data. It offers rich support for interacting with data, including paging, grouping, sorting, filtering and
editing.
Grid Features
Data Binding - our Grid supports the following data binding options:
o Local Data - load the javascript data grid from a local array of objects.
o Xml Data - load the javascript data grid from XML data source using AJAX.
o JSON Data - load the javascript data grid from JSON data source using AJAX.
o CSV Data - load the javascript data grid from CSV.
o Tab Data - load the javascript data grid from Tab-Delimited (TSV).
o Remote Data - load the javascript data grid using JSONP. JSONP (JSON with Padding) represents JSON data wrapped in a function call. JSONP is an
effective cross-domain communication technique frequently used to bypass the same-origin policy limitations.
o Virtual Data - jqxGrid can be populated with data on demand when the user scrolls or changes the current page.
Outlook-Style Grouping - the Grid can group data by dragging Grid columns into a toolbar above the Grid. Grouping can be achieved through API as well.
Sorting - one-click automatic sorting, selection of sort option from a context menu and sorting through API calls. The data grid automatically chooses the most
appropriate comparison. Users can also implement and use a custom sort comparer functions. The sorting works well with all possible configurations
including rows grouping and paging.
Filtering - users can filter data in two ways - through a context menu integrated in the Grid, or via a filter row.
Paging
Editing and Validation
Nested Grids
Row Details
Localization
Column Types
Columns Resizing
Columns Reorder
Columns Hierarchy
Pinned Columns
Foreign Columns
Cells Formatting
Custom Grid Filters
Custom Cells Rendering
Custom Cell Editors
Rows and Cells Selection
Aggregates
Export to Excel, XML, HTML, CSV, TSV, PDF and JSON
Printing
Responsive Size with Fluid dimensions
Accessibility
Keyboard Navigation
State Maitenance
Getting Started
Every UI widget from jQWidgets toolkit needs its JavaScript files to be included in order to work properly.
The first step is to create html page and add links to the javascript files and css dependencies to your project. The jqxGrid widget requires the following files:
Grid Modules
jqxgrid.js - Base Grid.
jqxgrid.grouping.js - This module adds a grouping feature into the Grid(optional).
jqxgrid.sort.js - This module adds a sorting feature into the Grid(optional).
jqxgrid.filter.js - This module adds a filtering feature into the Grid(optional).
jqxgrid.pager.js - This module adds a paging feature into the Grid(optional).
jqxgrid.columnsresize.js - This module adds a columns resizing feature into the Grid(optional).
jqxgrid.columnsreorder.js - This module adds a columns reorder feature into the Grid(optional).
jqxgrid.selection.js - This module adds a rows selection feature into the Grid(optional).
jqxgrid.edit.js - This module adds a cell editing feature into the Grid(optional).
jqxgrid.aggregates.js - This module adds an option to display aggregates in the Grid(optional).
jqxgrid.storage.js - This module adds an option to save and load the Grid's state(optional).
jqxgrid.export.js and jqxdata.export.js - This module adds an option to export the Grid's data to Excel, XML, CSV, TSV, HTML and JSON(optional).
The next step is to create a DIV element within the body of the html document.
<div id="jqxgrid">
</div>
The last step is to initialize the widget. In order to initialize the Grid, you need to set its source and columns properties. Add the following script to the html
document:
// prepare the data
var data = new Array();
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin", "Sven",
"Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson", "Winkler", "Bein",
"Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha", "Cramel Latte",
"Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < 1000; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
columns: [
{ text: 'First Name', datafield: 'firstname', width: 100 },
{ text: 'Last Name', datafield: 'lastname', width: 100 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2' }
]
});
To set a property(option), you need to pass the property name and value(s) in the jqxGrid's constructor.
$("#grid").jqxGrid({ disabled: true});
To get a property(option), you need to pass the property name to the jqxGrid's constructor.
var disabled = $("#grid").jqxGrid('disabled');
To call a function, you need to pass the function name and parameters(if any).
$("#jqxgrid").jqxGrid('selectrow', 1);
To bind to an event of a UI widget, you can use basic jQuery syntax. Let’s suppose that you want to get when the user selects a row. The example code below
demonstrates how to bind to the ‘rowselect’ event of jqxGrid.
$("#jqxgrid").on('rowselect', function (event) {
var rowindex = event.args.rowindex;
});
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example shows how to create a Grid from Array data.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var data = new Array();
var firstNames = [
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin",
"Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"];
var lastNames = [
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"];
var productNames = [
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"];
var priceValues = ["2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"];
for (var i = 0; i < 100; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
columns: [
{ text: 'First Name', datafield: 'firstname', width: 100 },
{ text: 'Last Name', datafield: 'lastname', width: 100 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2' }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid"></div>
</div>
</body>
</html>
XML
<entry>
<id>http://services.odata.org/Northwind/Northwind.svc/Orders(10248)</id>
<title type="text"></title>
<updated>2011-12-01T11:55:06Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Order" href="Orders(10248)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Customer"
type="application/atom+xml;type=entry" title="Customer" href="Orders(10248)/Customer" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Employee"
type="application/atom+xml;type=entry" title="Employee" href="Orders(10248)/Employee" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details"
type="application/atom+xml;type=feed" title="Order_Details" href="Orders(10248)/Order_Details" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Shipper"
type="application/atom+xml;type=entry" title="Shipper" href="Orders(10248)/Shipper" />
<category term="NorthwindModel.Order" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:OrderID m:type="Edm.Int32">10248</d:OrderID>
<d:CustomerID>VINET</d:CustomerID>
<d:EmployeeID m:type="Edm.Int32">5</d:EmployeeID>
<d:OrderDate m:type="Edm.DateTime">1996-07-04T00:00:00</d:OrderDate>
<d:RequiredDate m:type="Edm.DateTime">1996-08-01T00:00:00</d:RequiredDate>
<d:ShippedDate m:type="Edm.DateTime">1996-07-16T00:00:00</d:ShippedDate>
<d:ShipVia m:type="Edm.Int32">3</d:ShipVia>
<d:Freight m:type="Edm.Decimal">32.3800</d:Freight>
<d:ShipName>Vins et alcools Chevalier</d:ShipName>
<d:ShipAddress>59 rue de l'Abbaye</d:ShipAddress>
<d:ShipCity>Reims</d:ShipCity>
<d:ShipRegion m:null="true" />
<d:ShipPostalCode>51100</d:ShipPostalCode>
<d:ShipCountry>France</d:ShipCountry>
</m:properties>
</content>
</entry>
<entry>
<id>http://services.odata.org/Northwind/Northwind.svc/Orders(10249)</id>
<title type="text"></title>
<updated>2011-12-01T11:55:06Z</updated>
<author>
<name />
</author>
<link rel="edit" title="Order" href="Orders(10249)" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Customer"
type="application/atom+xml;type=entry" title="Customer" href="Orders(10249)/Customer" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Employee"
type="application/atom+xml;type=entry" title="Employee" href="Orders(10249)/Employee" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details"
type="application/atom+xml;type=feed" title="Order_Details" href="Orders(10249)/Order_Details" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Shipper"
type="application/atom+xml;type=entry" title="Shipper" href="Orders(10249)/Shipper" />
<category term="NorthwindModel.Order" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<content type="application/xml">
<m:properties>
<d:OrderID m:type="Edm.Int32">10249</d:OrderID>
<d:CustomerID>TOMSP</d:CustomerID>
<d:EmployeeID m:type="Edm.Int32">6</d:EmployeeID>
<d:OrderDate m:type="Edm.DateTime">1996-07-05T00:00:00</d:OrderDate>
<d:RequiredDate m:type="Edm.DateTime">1996-08-16T00:00:00</d:RequiredDate>
<d:ShippedDate m:type="Edm.DateTime">1996-07-10T00:00:00</d:ShippedDate>
<d:ShipVia m:type="Edm.Int32">1</d:ShipVia>
<d:Freight m:type="Edm.Decimal">11.6100</d:Freight>
<d:ShipName>Toms Spezialitäten</d:ShipName>
<d:ShipAddress>Luisenstr. 48</d:ShipAddress>
<d:ShipCity>Münster</d:ShipCity>
<d:ShipRegion m:null="true" />
<d:ShipPostalCode>44087</d:ShipPostalCode>
<d:ShipCountry>Germany</d:ShipCountry>
</m:properties>
</content>
</entry>
datafields: An array describing the fields in a particular record. Each datafield must define the following members:
o name - A string containing the data field's name.
o type - A string containing the data field's type. Possible values: 'string', 'date', 'number', 'float', 'int', 'bool'.
o format(optional) - Sets the data formatting. By setting the format, the jqxDataAdapter plug-in will try to format the data before loading it.
Example: { name: 'SubmitDate', type: 'date', format: "yyyy-MM-ddTHH:mm:ss-HH:mm" }
o map(optional) - A mapping to the data field.
Example with XML data:
{ name: 'CompanyName', map: 'm\\:properties>d\\:CompanyName' }
XML
<content type="application/xml">
<m:properties>
<d:CustomerID>ALFKI</d:CustomerID>
<d:CompanyName>Alfreds Futterkiste</d:CompanyName>
<d:ContactName>Maria Anders</d:ContactName>
<d:ContactTitle>Sales Representative</d:ContactTitle>
<d:Address>Obere Str. 57</d:Address>
<d:City>Berlin</d:City>
<d:Region m:null="true" />
<d:PostalCode>12209</d:PostalCode>
<d:Country>Germany</d:Country>
<d:Phone>030-0074321</d:Phone>
<d:Fax>030-0076545</d:Fax>
</m:properties>
</content>
Example with nested JSON data.
var data = [{ "empName": "test", "age": "67", "department": { "id": "1234", "name": "Sales" }, "author": "ravi"}];
// prepare the data
var source =
{
datatype: "json",
datafields: [
{ name: 'empName' },
{ name: 'age' },
{ name: 'id', map: 'department>id' },
{ name: 'name', map: 'department>name' },
{ name: 'author' }
],
localdata: data
};
var dataAdapter = new $.jqx.dataAdapter(source);
Example #2 with XML Attributes Let's load the following data into the Grid from a file named customers.xml.
Example with "values" This functionality allows you to join two or more data sources.
var employeesSource =
{
datatype: "xml",
datafields: [
{ name: 'FirstName', type: 'string' },
{ name: 'LastName', type: 'string' }
],
root: "Employees",
record: "Employee",
id: 'EmployeeID',
url: "../sampledata/employees.xml",
async: false
};
var employeesAdapter = new $.jqx.dataAdapter(employeesSource, {
autoBind: true,
beforeLoadComplete: function (records) {
var data = new Array();
// update the loaded records. Dynamically add EmployeeName and EmployeeID fields.
for (var i = 0; i < records.length; i++) {
var employee = records[i];
employee.EmployeeName = employee.FirstName + " " + employee.LastName;
employee.EmployeeID = employee.uid;
data.push(employee);
}
return data;
}
});
// prepare the data
var ordersSource =
{
datatype: "xml",
datafields: [
// name - determines the field's name.
// value - the field's value in the data source.
// values - specifies the field's values.
// values.source - specifies the foreign source. The expected value is an array.
// values.value - specifies the field's name in the foreign source.
// values.name - specifies the field's value in the foreign source.
// When the ordersAdapter is loaded, each record will have a field called "EmployeeName". The "EmployeeName"
for each record comes from the employeesAdapter where the record's "EmployeeID" from orders.xml matches to the
"EmployeeID" from employees.xml.
{ name: 'EmployeeName', value: 'EmployeeID', values: { source: employeesAdapter.records, value:
'EmployeeID', name: 'EmployeeName' } },
{ name: 'EmployeeID', map: 'm\\:properties>d\\:EmployeeID' },
{ name: 'ShippedDate', map: 'm\\:properties>d\\:ShippedDate', type: 'date' },
{ name: 'Freight', map: 'm\\:properties>d\\:Freight', type: 'float' },
{ name: 'ShipName', map: 'm\\:properties>d\\:ShipName' },
{ name: 'ShipAddress', map: 'm\\:properties>d\\:ShipAddress' },
{ name: 'ShipCity', map: 'm\\:properties>d\\:ShipCity' },
{ name: 'ShipCountry', map: 'm\\:properties>d\\:ShipCountry' }
],
root: "entry",
record: "content",
id: 'm\\:properties>d\\:OrderID',
url: "../sampledata/orders.xml",
pager: function (pagenum, pagesize, oldpagenum) {
// callback called when a page or page size is changed.
}
};
var ordersAdapter = new $.jqx.dataAdapter(ordersSource);
pagenum - determines the initial page number when paging is enabled.
pagesize - determines the page size when paging is enabled.
pager - callback function called when the current page or page size is changed.
pager: function (pagenum, pagesize, oldpagenum) {
}
sortcolumn - determines the initial sort column. The expected value is a data field name.
sortdirection - determines the sort order. The expected value is 'asc' for (A to Z) sorting or 'desc' for (Z to A) sorting.
sort - callback function called when the sort column or sort order is changed.
sort: function (column, direction) {
}
filter - callback function called when a filter is applied or removed.
filter: function (filters, recordsArray)
{
}
addrow - callback function, called when a new row is/are added. If multiple rows are added, the rowid and rowdata parameters are arrays of row ids
and rows.
addrow: function (rowid, rowdata, position, commit) {
// synchronize with the server - send insert command
// call commit with parameter true if the synchronization with the server is successful
//and with parameter false if the synchronization failed.
commit(true);
}
deleterow - callback function, called when a row is deleted. If multiple rows are deleted, the rowid parameter is an array of row ids.
If you bind the Grid to remote data source using asynchronous requests( that is by default when you specify url in the source object and you didn't set the
async field to false), then make sure that you call any method or set a property once the data is loaded. To ensure that you call your code when the Grid is
loaded with data, use the Grid's ready callback function or bind to the 'bindingcomplete' event before the Grid's initialization and call your code inside the
event handler.
What happens when the data source is changed? How to refresh the Grid?
To refresh the Grid, you need to simply set its 'source' property again.
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>Grid populated from Array.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var data = new Array();
var generatedata = function (rowscount) {
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra",
"Martin", "Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < rowscount; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
return data;
}
var source =
{
localdata: generatedata(50),
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function (data, status, xhr) { },
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$("#jqxgrid").jqxGrid(
{
width: 670,
source: dataAdapter,
columns: [
{ text: 'First Name', datafield: 'firstname', width: 100 },
{ text: 'Last Name', datafield: 'lastname', width: 100 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2' }
]
});
// refresh Grid data.
$('input').click(function () {
source.localdata = generatedata(50);
$("#jqxgrid").jqxGrid({ source: source });
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' >
<div id="jqxgrid"></div>
<input type="button" value="Refresh Data" />
</div>
</body>
</html>
Code Example:
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example shows how to create a Grid from XML data.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var url = "customers.xml";
You can also set the datafield's type in the source object initialization.
var source =
{
datatype: "xml",
datafields: [
{ name: 'ShippedDate', map: 'm\\:properties>d\\:ShippedDate', type: 'date' },
{ name: 'Freight', map: 'm\\:properties>d\\:Freight', type: 'float' },
{ name: 'ShipName', map: 'm\\:properties>d\\:ShipName' },
{ name: 'ShipAddress', map: 'm\\:properties>d\\:ShipAddress' },
{ name: 'ShipCity', map: 'm\\:properties>d\\:ShipCity' },
{ name: 'ShipCountry', map: 'm\\:properties>d\\:ShipCountry' }
],
root: "entry",
record: "content",
id: 'm\\:properties>d\\:OrderID',
url: url,
sortcolumn: 'ShipName',
sortdirection: 'asc'
};
The sortcolumn and sortdirection properties in the above code apply a sorting and a sort order to a Grid column.
When you bind the Grid to JSON data, you need to set the source object's datatype to 'json'.
Sample JSON data:
[
{"id": "1","name": "Hot Chocolate","type": "Chocolate Beverage","calories": "370","totalfat": "16g","protein": "14g"},
{"id": 2, "name": "Peppermint Hot Chocolate","type": "Chocolate Beverage","calories": "440","totalfat": "16g","protein": "13g"},
{"id": "3","name": "Salted Caramel Hot Chocolate","type": "Chocolate Beverage","calories": "450","totalfat": "16g","protein": "13g"},
{"id": "4","name": "White Hot Chocolate","type": "Chocolate Beverage","calories": "420","totalfat": "16g","protein": "12g"},
{"id": "5","name": "Caffe Americano","type": "Espresso Beverage","calories": "15","totalfat": "0g","protein": "1g"},
{"id": "6","name": "Caffe Latte","type": "Espresso Beverage","calories": "190","totalfat": "7g","protein": "12g"},
{"id": "7","name": "Caffe Mocha","type": "Espresso Beverage","calories": "330","totalfat": "15g","protein": "13g"},
{"id": "8","name": "Cappuccino","type": "Espresso Beverage","calories": "120","totalfat": "4g","protein": "8g"},
{"id": "9","name": "Caramel Brulee Latte", "type": "Espresso Beverage","calories": "420","totalfat": "9g","protein": "8g"},
{"id": "10","name": "Caramel Macchiato","type": "Espresso Beverage","calories": "240","totalfat": "11g","protein": "10g"},
{"id": "11","name": "Peppermint Hot Chocolate","type": "Espresso Beverage","calories": "440","totalfat": "10g","protein": "13g"},
{"id": "12","name": "Cinnamon Dolce Latte","type": "Espresso Beverage","calories": "260","totalfat": "6g","protein": "10g"},
{"id": "13","name": "Eggnog Latte","type": "Espresso Beverage","calories": "460","totalfat": "16g","protein": "13g"},
{"id": "14","name": "Espresso","type": "Espresso Beverage","calories": "5","totalfat": "1g","protein": "1g"},
{"id": "15","name": "Espresso Con Panna","type": "Espresso Beverage","calories": "30","totalfat": "1g","protein": "0g"},
{"id": "16","name": "Espresso Macchiato","type": "Espresso Beverage","calories": "100","totalfat": "1g","protein": "0g"},
{"id": "17","name": "Flavored Latte","type": "Espresso Beverage","calories": "250","totalfat": "6g","protein": "12g"},
{"id": "18","name": "Gingerbread Latte","type": "Espresso Beverage","calories": "320","totalfat": "13g","protein": "12g"},
{"id": "19","name": "White Chocolate Mocha","type": "Espresso Beverage","calories": "470","totalfat": "18g","protein": "15g"},
{"id": 20, "name": "Skinny Peppermint Mocha","type": "Espresso Beverage","calories": 130, "totalfat": "15g","protein": "13g"},
{"id": "21","name": "Skinny Flavored Latte","type": "Espresso Beverage","calories": "120","totalfat": "0g","protein": "12g"},
{"id": "22","name": "Pumpkin Spice Latte","type": "Espresso Beverage","calories": "380","totalfat": "13g","protein": "14g"},
{"id": "23","name": "Caffe Vanilla Frappuccino","type": "Frappuccino Blended Beverage","calories": "310","totalfat": "3g","protein": "3g"},
{"id": "24","name": "Caffe Vanilla Frappuccino L","type": "Frappuccino Blended Beverage","calories": "180","totalfat": "0g","protein": "3g"},
{"id": "25","name": "Caramel Brulee Frappuccino","type": "Frappuccino Blended Beverage","calories": "410","totalfat": "13g","protein": "4g"},
{"id": "26","name": "Caramel Brulee Frappuccino L","type": "Frappuccino Blended Beverage","calories": "190","totalfat": "0g","protein": "3g"},
{"id": "27","name": "Eggnog Frappuccino","type": "Frappuccino Blended Beverage","calories": "420","totalfat": "18g","protein": "7g"},
{"id": "28","name": "Mocha Frappuccino","type": "Frappuccino Blended Beverage","calories": "400","totalfat": "15g","protein": "5g"},
{"id": "29","name": "Tazo Green Tea Frappuccino","type": "Frappuccino Blended Beverage","calories": "430","totalfat": "16g","protein": "6g"}
]
Code example:
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>Grid populated from JSON.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var url = "beverages.txt";
// prepare the data
var source =
{
datatype: "json",
datafields: [{ name: 'name' },{ name: 'type' },{ name: 'calories' },{ name: 'totalfat' },{ name: 'protein' },],
id: 'id',
url: url
};
var dataAdapter = new $.jqx.dataAdapter(source, {
downloadComplete: function (data, status, xhr) { },
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$("#jqxgrid").jqxGrid(
{
width: 670,
source: dataAdapter,
columns: [
{ text: 'Name', datafield: 'name', width: 250 },
{ text: 'Beverage Type', datafield: 'type', width: 250 },
{ text: 'Calories', datafield: 'calories', width: 180 },
{ text: 'Total Fat', datafield: 'totalfat', width: 120 },
{ text: 'Protein', datafield: 'protein', width: 120 }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid"></div>
</div>
</body>
</html>
If you want to bind the Grid to JSONP data, then you need to set the source object's datatype to 'jsonp'.
When you bind the Grid to TSV data, you need to set the source object's datatype to 'tab'.
Code example:
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example shows how to create a Grid from Tab-delimited text also known as tab-separated values
(TSV).</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var source =
{
datatype: "tab",
datafields: [
{ name: 'Year', type: 'int' },
{ name: 'HPI', type: 'float' },
{ name: 'BuildCost', type: 'float' },
{ name: 'Population', type: 'float' },
{ name: 'Rate', type: 'float' }
],
url: 'homeprices.txt'
};
var dataAdapter = new $.jqx.dataAdapter(source);
$("#jqxgrid").jqxGrid(
{
width: 670,
source: dataAdapter,
columnsresize: true,
columns: [
{ text: 'Year', datafield: 'Year', width: 100, minwidth: 90, maxwidth: 150 },
{ text: 'HPI', datafield: 'HPI', cellsformat: 'f2', width: 100 },
{ text: 'Build Cost', datafield: 'BuildCost', cellsformat: 'c2', width: 180 },
{ text: 'Population', datafield: 'Population', cellsformat: 'f2', width: 100 },
{ text: 'Rate', datafield: 'Rate', cellsformat: 'f5', minwidth: 100 }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget'>
<div id="jqxgrid"></div>
</div>
</body>
</html>
When you bind the Grid to CSV data, you need to set the source object's datatype to 'csv'.
Code example:
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example shows how to create a Grid from Tab-delimited text also known as tab-separated values
(TSV).</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var source =
{
datatype: "tab",
datafields: [
{ name: 'Year', type: 'int' },
{ name: 'HPI', type: 'float' },
{ name: 'BuildCost', type: 'float' },
{ name: 'Population', type: 'float' },
{ name: 'Rate', type: 'float' }
],
url: 'homeprices.txt'
};
var dataAdapter = new $.jqx.dataAdapter(source);
$("#jqxgrid").jqxGrid(
{
width: 670,
source: dataAdapter,
columnsresize: true,
columns: [
{ text: 'Year', datafield: 'Year', width: 100, minwidth: 90, maxwidth: 150 },
{ text: 'HPI', datafield: 'HPI', cellsformat: 'f2', width: 100 },
{ text: 'Build Cost', datafield: 'BuildCost', cellsformat: 'c2', width: 180 },
{ text: 'Population', datafield: 'Population', cellsformat: 'f2', width: 100 },
{ text: 'Rate', datafield: 'Rate', cellsformat: 'f5', minwidth: 100 }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget'>
<div id="jqxgrid"></div>
</div>
</body>
</html>
Grid Sorting
(requires jqxgrid.sort.js)
The sortable property enables or disables the data sorting. The Grid sorting logic is implemented in the jqxgrid.sort.js and you need to reference that
javascript file. In the code example below, the Grid data sorting is enabled.
$("#jqxgrid").jqxGrid(
{
width: 670,
height: 450,
source: source,
theme: theme,
sortable: true,
columns: [
{ text: 'Ship Name', datafield: 'ShipName', width: 250 },
{ text: 'Shipped Date', datafield: 'ShippedDate', width: 230, cellsformat: 'D' },
{ text: 'Freight', datafield: 'Freight', width: 130, cellsformat: 'F2', cellsalign: 'right' },
{ text: 'Ship Address', datafield: 'ShipAddress', width: 350 },
{ text: 'Ship City', datafield: 'ShipCity', width: 100 },
{ text: 'Ship Country', datafield: 'ShipCountry', width: 100 }
]
});
To enable or disable the sorting of a Grid column, you can set its sortable property to false. In the code example below, the sorting of the "ShipName" column
is disabled.
$("#jqxgrid").jqxGrid(
{width: 670, height: 450, source: source, theme: theme, sortable: true, columns:
[
{ text: 'Ship Name', datafield: 'ShipName', width: 250, sortable: false },
{ text: 'Shipped Date', datafield: 'ShippedDate', width: 230, cellsformat: 'D' },
{ text: 'Freight', datafield: 'Freight', width: 130, cellsformat: 'F2', cellsalign: 'right' },
{ text: 'Ship Address', datafield: 'ShipAddress', width: 350 },
{ text: 'Ship City', datafield: 'ShipCity', width: 100 },
{ text: 'Ship Country', datafield: 'ShipCountry', width: 100 }
]
});
When the sorting data type is Date, Number or Boolean, the 'type' property in the 'datafields' array should be set.
In this code example, the data type of the ShippedDate column is Date and the "type" property is set to "date". The Freight column displays floating-point
numbers and the 'type' property is set to 'float'.
var source =
{
datatype: "xml",
datafields: [
{ name: 'ShippedDate', type: 'date' },
{ name: 'Freight', type: 'float' },
{ name: 'ShipName' },
{ name: 'ShipAddress'},
{ name: 'ShipCity'},
{ name: 'ShipCountry' }
],
root: "entry",
record: "content",
id: 'OrderID',
url: url,
sortcolumn: 'ShipName',
sortdirection: 'asc'
};
The 'sortcolumn' property specifies the default Grid sort column, i.e. when the grid is displayed, the data will be sorted. The 'sortdirection' property specifies
the sort order of the sort column.
The sortby function can be used to sort the Grid through the API. This function should be called when the grid data is fully loaded. The first parameter is the
Column's DataField. The second parameter is the sort order - 'asc' or 'desc'.
$("#jqxgrid").bind('bindingcomplete', function()
{
$("#jqxgrid").jqxGrid('sortby', 'ShipName', 'asc');
});
By default, when the sorting is enabled and the user clicks a column's header, the sort order is changed. The jqxGrid 'sorttogglestates' property can be used
to modify this behavior. The possible values of this property are:
Custom Sorting
To override the default sorting logic, you need to set the 'sort' member of the Grid's source object to a custom sorting function. The Grid will pass two
parameters to this function - the sort column's datafield and the sort direction.
Grid Filtering
(requires jqxgrid.filter.js)
To enable the filtering feature, you need to set the 'filterable' property to true and add a reference to the jqxgrid.filter.js file. When the value of the filterable
property is true, the Grid displays a filtering panel in the columns popup menus. jqxGrid has several methods that allow you to handle the data filtering –
addfilter, removefilter, applyfilters and clearfilters. The first method adds a filter to a grid column. The ‘removefilter’ method removes a filter from a grid
column. The ‘applyfilters’ method applies all filters to the grid and refreshes its contents. The last method clears the filtering.
1. The first step is to create a filter group. The filter group is a group of one or more filtering criterias.
var filter_or_operator = 1;
filtergroup.addfilter(filter_or_operator, filter1);
filtergroup.addfilter(filter_or_operator, filter2);
4. In the final step, we add the filter group to the first column and apply the filters by calling the ‘applyfilters’ method.
$("#jqxgrid").jqxGrid('removefilter', 'firstname');
$("#jqxgrid").jqxGrid('applyfilters');
If you want to clear all filters, use the ‘clearfilters’ method.
$("#jqxgrid").jqxGrid('clearfilters');
For Server-Side filtering, see the Server-side processing with PHP and MySQL help topic.
$("#jqxgrid").bind('bindingcomplete', function () {
var localizationobj = {};
filterstringcomparisonoperators = ['empty', 'not empty', 'contains', 'contains(match case)',
'does not contain', 'does not contain(match case)', 'starts with', 'starts with(match case)',
'ends with', 'ends with(match case)', 'equal', 'equal(match case)', 'null', 'not null'];
filternumericcomparisonoperators = ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than
or equal', 'null', 'not null'];
filterdatecomparisonoperators = ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or
equal', 'null', 'not null'];
filterbooleancomparisonoperators = ['equal', 'not equal'];
localizationobj.filterstringcomparisonoperators = filterstringcomparisonoperators;
localizationobj.filternumericcomparisonoperators = filternumericcomparisonoperators;
localizationobj.filterdatecomparisonoperators = filterdatecomparisonoperators;
localizationobj.filterbooleancomparisonoperators = filterbooleancomparisonoperators;
// apply localization.
$("#jqxgrid").jqxGrid('localizestrings', localizationobj);
});
2. The second step is to update the conditions within the Filter object. In order to achieve that, you need to add a function called "updatefilterconditions".
That function is invoked by jqxGrid with 2 parameters - the type of the filter and the default filter conditions. As a result, the function should return an array
of strings depending on the filter's type. That array will be used by the filter object..
$("#jqxgrid").jqxGrid(
{
source: source,
filterable: true,
sortable: true,
updatefilterconditions: function (type, defaultconditions) {
var stringcomparisonoperators = ['EMPTY', 'NOT_EMPTY', 'CONTAINS', 'CONTAINS_CASE_SENSITIVE',
'DOES_NOT_CONTAIN', 'DOES_NOT_CONTAIN_CASE_SENSITIVE', 'STARTS_WITH', 'STARTS_WITH_CASE_SENSITIVE',
'ENDS_WITH', 'ENDS_WITH_CASE_SENSITIVE', 'EQUAL', 'EQUAL_CASE_SENSITIVE', 'NULL', 'NOT_NULL'];
var numericcomparisonoperators = ['EQUAL', 'NOT_EQUAL', 'LESS_THAN', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN',
'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL'];
var datecomparisonoperators = ['EQUAL', 'NOT_EQUAL', 'LESS_THAN', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN',
'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL'];
var booleancomparisonoperators = ['EQUAL', 'NOT_EQUAL'];
switch (type) {
case 'stringfilter':
return stringcomparisonoperators;
case 'numericfilter':
return numericcomparisonoperators;
case 'datefilter':
return datecomparisonoperators;
case 'booleanfilter':
return booleancomparisonoperators;
}
},
autoshowfiltericon: true,
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', cellsalign: 'right', cellsformat: 'c2' }
]
});
By default the filter groups are combined with 'AND' operator. That means that the Grid will display records if they meet the criteria of the filter group applied
to column 1 and the filter group applied to column 2, etc. You can create any combination of filter groups using 'AND' and 'OR'.
The example below illustrates how:
Paging
(requires jqxgrid.pager.js)
The Grid plugin has a built-in paging capability that supports paging functionality. The paging functionality is implemented in the jqxgrid.pager.js and is
enabled when the 'pageable' property is set to true. The code example below illustrates how to enable the paging functionality.
$("#jqxgrid").jqxGrid(
{
source: source,
pageable: true,
autoheight: true,
columns: [
{ text: 'Ship Name', datafield: 'ShipName', width: 250 },
{ text: 'Shipped Date', datafield: 'ShippedDate', width: 230, cellsformat: 'D' },
{ text: 'Freight', datafield: 'Freight', width: 130, cellsformat: 'F2', cellsalign: 'right' },
{ text: 'Ship Address', datafield: 'ShipAddress', width: 350 },
{ text: 'Ship City', datafield: 'ShipCity', width: 100 },
{ text: 'Ship Country', datafield: 'ShipCountry', width: 101 }
]
});
When a page is changed or the page size is changed, the Grid raises the pagechanged or pagesizechanged events.
$("#jqxgrid").bind("pagechanged", function (event) {
var args = event.args;
var pagenumber = args.pagenum;
var pagesize = args.pagesize;
});
$("#jqxgrid").bind("pagesizechanged", function (event) {
var args = event.args;
var pagenumber = args.pagenum;
var pagesize = args.pagesize;
});
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example illustrates how to customize the Grid plugin's Pager.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.pager.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var data = new Array();
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin",
"Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < 100; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
var pagerrenderer = function () {
var element = $("<div style='margin-top: 5px; width: 100%; height: 100%;'></div>");
var paginginfo = $("#jqxgrid").jqxGrid('getpaginginformation');
for (i = 0; i < paginginfo.pagescount; i++) {
// add anchor tag with the page number for each page.
var anchor = $("<a style='padding: 5px;' href='#" + i + "'>" + i + "</a>");
anchor.appendTo(element);
anchor.click(function (event) {
// go to a page.
var pagenum = parseInt($(event.target).text());
$("#jqxgrid").jqxGrid('gotopage', pagenum);
});
}
return element;
}
$("#jqxgrid").jqxGrid(
{width: 670, source: source, pageable: true, autoheight: true, pagerrenderer: pagerrenderer,
columns: [
{ text: 'First Name', datafield: 'firstname', width: 100 },
{ text: 'Last Name', datafield: 'lastname', width: 100 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsalign: 'right', cellsformat: 'c2' }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid">
</div>
</div>
</body>
</html>
The Grid Page Size options are displayed in a DropDownList plugin in the pager area. By default, the size options are 5, 10 and 20. The 'pagesizeoptions'
property enables you to set new size options.
The 'pagerrenderer' property allows you to customize the UI of the Grid pager. In the sample below, we create a pagerrenderer function and inside the
function, we build a DIV element with anchor tags. Each anchor tag has a page number as text. When the user clicks an anchor tag, the Grid calls the
'gotopage' function to navigate to a page. The 'pagerrenderer' function returns the DIV element as a result. This element is then internally appended to the
Grid's pager area.
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example illustrates how to customize the Grid plugin's Pager.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.pager.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var data = new Array();
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin",
"Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < 100; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
var pagerrenderer = function () {
var element = $("<div style='margin-top: 5px; width: 100%; height: 100%;'></div>");
var paginginfo = $("#jqxgrid").jqxGrid('getpaginginformation');
for (i = 0; i < paginginfo.pagescount; i++) {
// add anchor tag with the page number for each page.
var anchor = $("<a style='padding: 5px;' href='#" + i + "'>" + i + "</a>");
anchor.appendTo(element);
anchor.click(function (event) {
// go to a page.
var pagenum = parseInt($(event.target).text());
$("#jqxgrid").jqxGrid('gotopage', pagenum);
});
}
return element;
}
$("#jqxgrid").jqxGrid(
{
width: 670,
source: source,
pageable: true,
autoheight: true,
pagerrenderer: pagerrenderer,
columns: [
{ text: 'First Name', datafield: 'firstname', width: 100 },
{ text: 'Last Name', datafield: 'lastname', width: 100 },
{ text: 'Product', datafield: 'productname', width: 180 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
{ text: 'Total', datafield: 'total', cellsalign: 'right', cellsformat: 'c2' }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid">
</div>
</div>
</body>
</html>
To navigate to a page with the Grid API, use the 'gotopage' function.
$("#jqxgrid").jqxGrid('gotopage', 1);
The 'gotoprevpage' function navigates with 1 page before the current page.
The 'gotonextpage' function navigates with 1 page after the current page.
For Server-Side paging, see the Server-side processing with PHP and MySQL help topic.
The Grid plugin supports data grouping against one or more columns.
Grouping is allowed if the 'groupable' property is set to true and there's a reference to the jqxgrid.grouping.js file. End-users can group data by dragging
column headers to the Group Panel. This panel's visibility is controlled by the showgroupsheader property.
The code example below initializes a Grid with one grouping column.
$("#jqxgrid").jqxGrid(
{
source: source,
columns: [
{ text: 'Ship Name', datafield: 'ShipName', width: 250 },
{ text: 'Ship City', datafield: 'ShipCity', width: 100 },
{ text: 'Ship Country', datafield: 'ShipCountry' }
],
groupable: true,
groups: ['ShipCity']
});
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example illustrates how to enable the jQuery Grid Grouping functionality.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.grouping.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var data = new Array();
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin",
"Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < 50; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
$("#jqxgrid").jqxGrid(
{
height: 300,
source: source,
groupable: true,
columns: [
{ text: 'First Name', datafield: 'firstname' },
{ text: 'Last Name', datafield: 'lastname' },
{ text: 'Product', datafield: 'productname' }
],
groups: ['productname']
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid"></div>
</div>
</body>
</html>
To hide the grouping panel, set the 'showgroupsheader' property to false.
$("#jqxgrid").jqxGrid('showgroupsheader', false);
The 'addgroup', 'insertgroup', 'removegroup' and 'removegroupat' functions enable groups manipulation with the Grid API.
$("#jqxgrid").jqxGrid('addgroup', 'lastname');
*The functions should be called after the Grid data is loaded. When the data is loaded and the Grid is ready, the 'bindingcomplete' event is raised.
The 'closeablegroups' property enables or disables the close buttons displayed in each group header.
$("#jqxgrid").jqxGrid('closeablegroups', false);
The 'expandgroup' and 'collapsegroup' functions expand or collapse a group at a specific index. The code below expands the second group:
$("#jqxgrid").jqxGrid('expandgroup', 1);
The 'expandallgroups' and 'collapseallgroups' functions expand or collapse all groups in the Grid.
$("#jqxgrid").jqxGrid('expandallgroups');
Grid Localization
jqxGrid
The Grid plugin can localize all the displayed strings by passing a localization object to the 'localizestrings' function.
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>Grid with localization.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.pager.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var data = new Array();
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin",
"Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < 100; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
var date = new Date();
date.setDate(Math.floor(Math.random() * 27));
date.setMonth(Math.floor(Math.random() * 12));
row["name"] = firstNames[Math.floor(Math.random() * firstNames.length)] + ' ' +
lastNames[Math.floor(Math.random() * lastNames.length)];
row["date"] = date;
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
$("#jqxgrid").jqxGrid(
{
width: 670,
source: source,
pageable: true,
autoheight: true,
columns: [
{ text: 'Name', datafield: 'name', width: 130 },
{ text: 'Order Date', datafield: 'date', cellsformat: 'D' },
{ text: 'Product', datafield: 'productname', width: 160 },
{ text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
{ text: 'Unit Price', datafield: 'price', width: 80, cellsalign: 'right', cellsformat: 'c2' },
]
});
var localizationobj = {};
localizationobj.pagergotopagestring = "Gehe zu:";
localizationobj.pagershowrowsstring = "Zeige Zeile:";
localizationobj.pagerrangestring = " von ";
localizationobj.pagernextbuttonstring = "voriger";
localizationobj.pagerpreviousbuttonstring = "nächster";
localizationobj.sortascendingstring = "Sortiere aufsteigend";
localizationobj.sortdescendingstring = "Sortiere absteigend";
localizationobj.sortremovestring = "Entferne Sortierung";
localizationobj.firstDay = 1;
localizationobj.percentsymbol = "%";
localizationobj.currencysymbol = "€";
localizationobj.currencysymbolposition = "before";
localizationobj.decimalseparator = ".";
localizationobj.thousandsseparator = ",";
var days = {
// full day names
names: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
// abbreviated day names
namesAbbr: ["Sonn", "Mon", "Dien", "Mitt", "Donn", "Fre", "Sams"],
// shortest day names
namesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
};
localizationobj.days = days;
var months = {
// full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
names: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober",
"November", "Dezember", ""],
// abbreviated month names
namesAbbr: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dez", ""]
};
localizationobj.months = months;
// apply localization.
$("#jqxgrid").jqxGrid('localizestrings', localizationobj);
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body style="overflow: hidden;" class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid"></div>
</div>
</body>
</html>
{
// separator of parts of a date (e.g. '/' in 11/05/1955)
'/': "/",
// separator of parts of a time (e.g. ':' in 05:44 PM)
':': ":",
// the first day of the week (0 = Sunday, 1 = Monday, etc)
firstDay: 0,
days: {
// full day names
names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
// abbreviated day names
namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
// shortest day names
namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
},
months: {
// full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November",
"December", ""],
// abbreviated month names
namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""]
},
// AM and PM designators in one of these forms:
// The usual view, and the upper and lower case versions
// [standard,lowercase,uppercase]
// The culture does not use AM or PM (likely all standard date formats use 24 hour time)
// null
AM: ["AM", "am", "AM"],
PM: ["PM", "pm", "PM"],
eras: [
// eras in reverse chronological order.
// name: the name of the era in this culture (e.g. A.D., C.E.)
// start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
// offset: offset in years from gregorian calendar
{"name": "A.D.", "start": null, "offset": 0 }
],
twoDigitYearMax: 2029,
patterns: {
// short date pattern
d: "M/d/yyyy",
// long date pattern
D: "dddd, MMMM dd, yyyy",
// short time pattern
t: "h:mm tt",
// long time pattern
T: "h:mm:ss tt",
// long date, short time pattern
f: "dddd, MMMM dd, yyyy h:mm tt",
// long date, long time pattern
F: "dddd, MMMM dd, yyyy h:mm:ss tt",
// month/day pattern
M: "MMMM dd",
// month/year pattern
Y: "yyyy MMMM",
// S is a sortable format that does not vary by culture
S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
},
percentsymbol: "%",
currencysymbol: "$",
currencysymbolposition: "before",
decimalseparator: '.',
thousandsseparator: ',',
pagergotopagestring: "Go to page:",
pagershowrowsstring: "Show rows:",
pagerrangestring: " of ",
pagerpreviousbuttonstring: "previous",
pagernextbuttonstring: "next",
groupsheaderstring: "Drag a column and drop it here to group by that column",
sortascendingstring: "Sort Ascending",
sortdescendingstring: "Sort Descending",
sortremovestring: "Remove Sort",
groupbystring: "Group By this column",
groupremovestring: "Remove from groups",
filterclearstring: "Clear",
filterstring: "Filter",
filtershowrowstring: "Show rows where:",
filtershowrowdatestring: "Show rows where date:",
filterorconditionstring: "Or",
filterandconditionstring: "And",
filterselectallstring: "(Select All)",
filterchoosestring: "Please Choose:",
filterstringcomparisonoperators: ['empty', 'not empty', 'contains', 'contains(match case)',
'does not contain', 'does not contain(match case)', 'starts with', 'starts with(match case)',
'ends with', 'ends with(match case)', 'equal', 'equal(match case)', 'null', 'not null'],
filternumericcomparisonoperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or
equal', 'null', 'not null'],
filterdatecomparisonoperators: ['equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or
equal', 'null', 'not null'],
filterbooleancomparisonoperators: ['equal', 'not equal'],
validationstring: "Entered value is not valid",
emptydatastring: "No data to display",
filterselectstring: "Select Filter",
loadtext: "Loading...",
clearstring: "Clear",
todaystring: "Today"
};
{
firstDay: 1,
days: {
// full day names
names: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
// abbreviated day names
namesAbbr: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
// shortest day names
namesShort: "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]
},
months: {
// full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
names: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember",
""],
// abbreviated month names
namesAbbr: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""]
},
// AM and PM designators in one of these forms:
// The usual view, and the upper and lower case versions
// [standard,lowercase,uppercase]
// The culture does not use AM or PM (likely all standard date formats use 24 hour time)
// null
AM: ["Vormittag", "vormittag", "Vormittag"],
PM: ["Nachmittag", "nachmittag", "Nachmittag"],
eras: [
// eras in reverse chronological order.
// name: the name of the era in this culture (e.g. A.D., C.E.)
// start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
// offset: offset in years from gregorian calendar
{"name": "n. Chr.", "start": null, "offset": 0 }
],
twoDigitYearMax: 2100,
patterns: {
// short date pattern
d: "dd.MM.yyyy",
// long date pattern
D: "dddd, am dd.MM.yyyy",
// short time pattern
t: "hh:mm tt",
// long time pattern
T: "hh:mm:ss tt",
// long date, short time pattern
f: "dddd, MMMM dd, yyyy h:mm tt",
// long date, long time pattern
F: "dddd, MMMM dd, yyyy h:mm:ss tt",
// month/day pattern
M: "MMMM dd",
// month/year pattern
Y: "yyyy MMMM",
// S is a sortable format that does not vary by culture
S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
},
percentsymbol: "%",
currencysymbol: "€",
currencysymbolposition: "after",
decimalseparator: ',',
thousandsseparator: '.',
pagergotopagestring: "Gehe zu:",
pagershowrowsstring: "Zeige Zeile:",
pagerrangestring: " von ",
pagerpreviousbuttonstring: "voriger",
pagernextbuttonstring: "nächster",
groupsheaderstring: "Ziehen Sie eine Spalte hierher um eine Gruppe zu erstellen",
sortascendingstring: "Sortiere aufsteigend",
sortdescendingstring: "Sortiere absteigend",
sortremovestring: "Entferne Sortierung",
groupbystring: "Gruppiere nach dieser Spalte",
groupremovestring: "Entferne Gruppierung",
filterclearstring: "Aufheben",
filterstring: "Filter",
filtershowrowstring: "Zeige Zeilen wo:",
filterorconditionstring: "Oder",
filterandconditionstring: "Und",
filterstringcomparisonoperators: ['leer', 'nicht leer', 'enthält', 'enthält(Klein-/Großschreibung beachten)',
'enthält nicht', 'enthält nicht(Klein-/Großschreibung beachten)', 'startet mit', 'startet mit(Klein-/Großschreibung beachten)',
'endet mit', 'endet mit(Klein-/Großschreibung beachten)', 'gleich', 'gleich(Klein-/Großschreibung beachten)', 'undefiniert',
'nicht undefiniert'],
filternumericcomparisonoperators: ['gleich', 'ungleich', 'kleiner als', 'kleiner gleich', 'größer als', 'größer gleich',
'undefiniert', 'nicht undefiniert'],
filterdatecomparisonoperators: ['gleich', 'ungleich', 'früher als', 'früher gleich', 'später als', 'später gleich',
'undefiniert', 'nicht undefiniert']
validationstring: "Der eingegebene Wert ist nicht gültig"
};
You can also use the custom cells rendering feature to center the text in the Grid cells and columns.
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>This example shows how to change the Center the Grid Columns and Cells.</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
<script type="text/javascript" src="../../scripts/gettheme.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var theme = getTheme();
// prepare the data
var data = new Array();
var firstNames =
[
"Andrew", "Nancy", "Shelley", "Regina", "Yoshi", "Antoni", "Mayumi", "Ian", "Peter", "Lars", "Petra", "Martin",
"Sven", "Elio", "Beate", "Cheryl", "Michael", "Guylene"
];
var lastNames =
[
"Fuller", "Davolio", "Burke", "Murphy", "Nagase", "Saavedra", "Ohno", "Devling", "Wilson", "Peterson",
"Winkler", "Bein", "Petersen", "Rossi", "Vileid", "Saylor", "Bjorn", "Nodier"
];
var productNames =
[
"Black Tea", "Green Tea", "Caffe Espresso", "Doubleshot Espresso", "Caffe Latte", "White Chocolate Mocha",
"Cramel Latte", "Caffe Americano", "Cappuccino", "Espresso Truffle", "Espresso con Panna", "Peppermint Mocha Twist"
];
var priceValues =
[
"2.25", "1.5", "3.0", "3.3", "4.5", "3.6", "3.8", "2.5", "5.0", "1.75", "3.25", "4.0"
];
for (var i = 0; i < 50; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row["firstname"] = firstNames[Math.floor(Math.random() * firstNames.length)];
row["lastname"] = lastNames[Math.floor(Math.random() * lastNames.length)];
row["productname"] = productNames[productindex];
row["price"] = price;
row["quantity"] = quantity;
row["total"] = new Number(price * quantity).toFixed(2);
data[i] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source);
var cellsrenderer = function (row, column, value) {
return '<div style="text-align: center; margin-top: 5px;">' + value + '</div>';
}
var columnrenderer = function (value) {
return '<div style="text-align: center; margin-top: 5px;">' + value + '</div>';
}
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
columns: [
{ text: 'First Name', dataField: 'firstname', renderer: columnrenderer, cellsrenderer: cellsrenderer, width:
100 },
{ text: 'Last Name', dataField: 'lastname', renderer: columnrenderer, cellsrenderer: cellsrenderer, width:
100 },
{ text: 'Product', dataField: 'productname', renderer: columnrenderer, cellsrenderer: cellsrenderer, width:
180 },
{ text: 'Quantity', dataField: 'quantity', renderer: columnrenderer, cellsrenderer: cellsrenderer, width:
80 },
{ text: 'Unit Price', dataField: 'price', renderer: columnrenderer, cellsrenderer: cellsrenderer, width: 90},
{ text: 'Total', dataField: 'total', renderer: columnrenderer, cellsrenderer: cellsrenderer, width: 90}
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget'>
<div id="jqxgrid"></div>
</div>
</body>
</html>
jqxGrid Cell Editing feature much resembles the data entering experience in an Excel Spreadsheet – once you select a grid cell, you can enter data when you
start typing text. In order to use the Cells Editing feature, you need to reference the jqxgrid.edit.js in your project and also to include the javascript files
required by some of the editors. The Grid's 'editable' property specifies whether the editing is enabled or not.
Programmatic Editing
The Grid have APIs for showing and hiding the cell editors. The 'begincelledit' method allows you to put a specific cell into edit mode.
$("#jqxgrid").jqxGrid('begincelledit', 0, 'firstname');
The 'endcelledit' method ends the edit operation and confirms or cancels the changes. The following code cancels the changes.
$("#jqxgrid").jqxGrid('endcelledit', 0, 'firstname', true);
To set a new value to a Grid cell, you can use the 'setcellvalue' method:
// the first parameter is the row's index.
// the second parameter is the column's datafield.
// the third parameter is the new cell's value.
$("#jqxgrid").jqxGrid('setcellvalue', 0, 'lastname', 'My Value');
To get the value of a Grid cell, you can use the 'getcellvalue' method:
// the first parameter is the row's index.
// the second parameter is the column's datafield.
var value = $("#jqxgrid").jqxGrid('getcellvalue', 0, 'lastname');
The 'cellbeginedit' and 'cellendedit' events are raised when the edit operation begins or ends.
$("#jqxgrid").on('cellbeginedit', function (event) {
var args = event.args;
var columnDataField = args.datafield;
var rowIndex = args.rowindex;
var cellValue = args.value;
});
$("#jqxgrid").on('cellendedit', function (event) {
var args = event.args;
var columnDataField = args.datafield;
var rowIndex = args.rowindex;
var cellValue = args.value;
var oldValue = args.oldvalue;
});
Editor Types
jqxGrid supports the following types of editors:
TextBox
CheckBox(uses the jqxCheckBox widget)
NumberInput(uses the jqxNumberInput widget and edits currency, percentange and any type of numeric information)
DateTimeInput(uses the jqxDateTimeInput widget and edits date and time values)
DropDownList(uses the jqxDropDownList widget and selects a single value from a list of values)
To specify the column's editor, you should set the column's 'columntype' property to 'textbox', 'dropdownlist', 'numberinput', 'checkbox' or 'datetimeinput'.
To disable the editing of a specific grid column, you can set the column's editable property to false. The 'initeditor' function is called when the editor's widget
is initialized. It allows you to use the properties of the widget and make it best fit your application's scenario.
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
editable: true,
theme: theme,
selectionmode: 'singlecell',
columns: [
{ text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 },
{ text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 90 },
{ text: 'Product', columntype: 'dropdownlist', datafield: 'productname', width: 180 },
{ text: 'Available', datafield: 'available', columntype: 'checkbox', width: 65 },
{ text: 'Ship Date', datafield: 'date', columntype: 'datetimeinput', width: 90, cellsalign: 'right', cellsformat: 'd'},
{ text: 'Quantity', datafield: 'quantity', width: 70, cellsalign: 'right', columntype: 'numberinput',
initeditor: function (row, cellvalue, editor) {
editor.jqxNumberInput({ decimalDigits: 0 });
}
},
{ text: 'Price', datafield: 'price', width: 65, cellsalign: 'right', cellsformat: 'c2', columntype: 'numberinput',
initeditor: function (row, cellvalue, editor) {
editor.jqxNumberInput({ digits: 3 });
}
}
]
});
Please note that in order to use the 'dropdownlist', 'numberinput', 'checkbox' or 'datetimeinput' editors you need to include the necessary javascript files.
Validation
The Grid will display a validation popup message when the new cell’s value is not valid. The developers are able to set a custom validation logic and error
messages for each grid column. The Grid will stay in edit mode until a correct value is entered or the user presses the “Esc” key.
In following code, the "Ship Date", "Quantity" and "Price" columns define custom validation functions. Each function has 2 parameters - the edit cell and its
value. Depending on your logic, you can validate the value and return true if the value is correct or false, if the value is not correct. You can also return an
object with 2 members - result and message. The message member represents the message that your users will see, if the validation fails.
$("#jqxgrid").jqxGrid(
{
width: 670,
source: dataAdapter,
editable: true,
theme: theme,
selectionmode: 'singlecell',
columns: [
{ text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 },
{ text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 90 },
{ text: 'Product', columntype: 'dropdownlist', datafield: 'productname', width: 180 },
{ text: 'Available', datafield: 'available', columntype: 'checkbox', width: 65 },
{ text: 'Ship Date', datafield: 'date', columntype: 'datetimeinput', width: 90, cellsalign: 'right', cellsformat: 'd',
validation: function (cell, value) {
var year = value.getFullYear();
if (year >= 2013) {
return { result: false, message: "Ship Date should be before 1/1/2013" };
}
return true;
}
},
{ text: 'Quantity', datafield: 'quantity', width: 70, cellsalign: 'right', columntype: 'numberinput',
validation: function (cell, value) {
if (value < 0 || value > 100) {
return { result: false, message: "Quantity should be in the 0-100 interval" };
}
return true;
},
initeditor: function (row, cellvalue, editor) {
editor.jqxNumberInput({ decimalDigits: 0 });
}
},
{ text: 'Price', datafield: 'price', width: 65, cellsalign: 'right', cellsformat: 'c2', columntype: 'numberinput',
validation: function (cell, value) {
if (value < 0 || value > 15) {
return { result: false, message: "Price should be in the 0-15 interval" };
}
return true;
},
initeditor: function (row, cellvalue, editor) {
editor.jqxNumberInput({ digits: 3 });
}
}
]
});
For Server-Side cells editing, see the Server-side processing with PHP and MySQL help topic.
jqxGrid supports 10 selection modes - 'none', 'singlerow', 'multiplerows', 'multiplerowsextended', 'multiplerowsadvanced', 'singlecell', multilpecells',
'multiplecellsextended', 'multiplecellsadvanced' and 'checkbox' The cells and rows selection is implemented in the jqxgrid.selection.js. The default selection
mode is set to 'singlerow'. In order to change the selection mode, you need to set the Grid's 'selectionmode' property.
none - disables the selection
singlerow - allows you to select only one row via a mouse click on a grid row or by using the keyboard arrow keys, page up/down, home and end keys.
multiplerows - this selection mode allows you to select multiple rows via a mouse click. Clicking an already selected row will unselect it.
multiplerowsextended - this selection mode allows you to select multiple rows via a drag and drop. The selection behavior resembles the selection of
icons on your desktop.
multiplerowsadvanced - this selection mode allows you to select multiple rows by holding Shift or Ctrl keys while clicking on Grid rows.
checkbox - this selection mode allows you to select multiple rows by clicking checkboxes.
singlecell - allows you to select only one cell via a mouse click on a grid cell or by using the keyboard arrow keys, page up/down, home and end keys.
multiplerows - this selection mode allows you to select multiple cells via a mouse click. Clicking an already selected cell will unselect it.
multiplecellsextended - this selection mode allows you to select multiple cells via a drag and drop. The selection behavior resembles the selection of
icons on your desktop.
multiplecellsadvanced - this selection mode allows you to select multiple cells via a drag and drop. The selection behavior resembles the selection in
MS Excel.
The following code sets the Grid's 'selectionmode':
$("#jqxgrid").jqxGrid({selectionmode: 'multiplecellsextended'});
Rows Selection API - when the selection mode is set to 'singlerow', 'multiplerows', 'checkbox', 'multiplerowsadvanced'
or 'multiplerowsextended'.
- selectrow, unselectrow, getselectedrowindex and getselectedrowindexes. The rowselect and rowunselect events are raised
when the user selects or unselects a row.
Cells Selection API - when the selection mode is set to 'singlecell', 'multiplecells', 'multiplecellsadvanced' or
'multiplecellsextended'.
- selectcell, unselectcell, getselectedcell and getselectedcells. The cellselect and cellunselect events are raised when
the user selects or unselects a cell.
The following code will select a cell which is in the tenth row and in a column with 'firstname' datafield.
The following code shows how to subscribe to the 'cellselect' and 'cellunselect' events:
The 'clearselection' method allows you to clear the selection - removes the selection in all selected rows and cells.
$("#jqxgrid").jqxGrid('clearselection');
Keyboard Navigation
$("#jqxgrid").jqxGrid({keyboardnavigation: false});
<div id="jqxgrid"></div>
3. Create the source object and a new instance of the jqxDataAdapter plug-in. In the source object, set the "url" to point to the JSONP service. The members
and their values defined in the data object will be sent to the server. The "datatype" member should be set to ‘jsonp’ and we also specify the datafields array.
Each datafield name is a name of a member in the data source. The jqxDataAdapter's "formatData" callback function is called when the Grid is preparing to
send a new Ajax request to the server. The result of that function determines the parameters sent to the server.
4. The final step is to initialize the Grid. We achieve this by selecting the jqxgrid DIV tag and calling the jqxGrid constructor. In the constructor, we set the
source property to point to the source object. We also initialize the Grid columns by setting the displayed text, datafield which points to a datafield in the
source object and the column’s width.
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
columnsresize: true,
columns: [
{ text: 'Country Name', datafield: 'countryName', width: 200 },
{ text: 'City', datafield: 'name', width: 170 },
{ text: 'Population', datafield: 'population', cellsformat: 'f', width: 170 },
{ text: 'Continent Code', datafield: 'continentCode', minwidth: 110 }
]
});
Working Example
Below is the example's full source code:
<!DOCTYPE html>
<html lang="en">
<head>
<title id='Description'>In this example the Grid is bound to a Remote Data.</title>
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// prepare the data
var source =
{
datatype: "jsonp",
datafields: [
{ name: 'countryName', type: 'string' },
{ name: 'name', type: 'string' },
{ name: 'population', type: 'float' },
{ name: 'continentCode', type: 'string' }
],
url: "http://ws.geonames.org/searchJSON"
};
var dataAdapter = new $.jqx.dataAdapter(source,
{
formatData: function (data) {
$.extend(data, {
featureClass: "P",
style: "full",
username: "jqwidgets",
maxRows: 50
});
return data;
}
}
);
$("#jqxgrid").jqxGrid(
{
source: dataAdapter,
columnsresize: true,
columns: [
{ text: 'Country Name', datafield: 'countryName', width: 200 },
{ text: 'City', datafield: 'name', width: 170 },
{ text: 'Population', datafield: 'population', cellsformat: 'f', width: 170 },
{ text: 'Continent Code', datafield: 'continentCode', minwidth: 110 }
]
});
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2FX5PV9DNT"></script><script>window.dataLayer =
window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-
2FX5PV9DNT');</script></head>
<body class='default'>
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana; float: left;">
<div id="jqxgrid"></div>
</div>
</body>
</html>
In the following example code, we define a data object with three members. The members and their values defined in the data object will be sent to the
server.
// prepare the data
var source =
{
datatype: "jsonp",
datafields: [
{ name: 'countryName' },
{ name: 'name' },
{ name: 'population', type: 'float' },
{ name: 'continentCode' }
],
url: "http://ws.geonames.org/searchJSON",
data: {
featureClass: "P",
style: "full",
maxRows: 50
}
};
The data is converted into a query string using jQuery.param() before it is sent. The above code is appropriate for static data sent to the server.
The parameter passed to the 'formatData' function represents the data object which includes all settings defined by you in the source object's data member
and all settings by the Grid('sortdatafield', 'sortorder', etc.).
Sending data to the server when using the jqxGrid with PHP
jQuery will automatically convert the data object into a string and send in the following format:
"pagenum=0&pagesize=10&featureClass=P&style=full&maxRows=50"
Then, in your PHP code, you can get the values of the pagenum and pagesize by using this code:
$pagenum = $_GET['pagenum'];
$pagesize = $_GET['pagesize'];
Sending data to the server when using the jqxGrid with ASP .NET
ASP.NET AJAX script services and page methods understand and expect input parameters to be serialized as JSON strings. These parameters are parsed out
of the POST data and used as arguments to the method you’ve called.
However, as the Grid provides a JSON object as a data parameter for an $.ajax call, jQuery will convert the object into a query string using jQuery.param().
Take this sample request, for example where data is defined as {featureClass: "P", style: "full", maxRows: 50};:
$.ajax({
type: "POST",
url: "WebService.asmx/WebMethodName",
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json"
});
jQuery will automatically convert the object into a string and send it as:
"featureClass=P&style=full&maxRows=50".
This is OK, if you are using the Grid with PHP, but in ASP .NET, the server will respond with "Invalid JSON primitive" error.
The solution in ASP .NET application scenarios is to make sure that you’re passing a string for the data parameter, like this:
$.ajax({
type: "POST",
url: "WebService.asmx/WebMethodName",
data: "{'featureClass': 'P', 'style': 'full', 'maxRows': '50'}",
contentType: "application/json; charset=utf-8",
dataType: "json"
});
With jqxGrid, the above data string can be achieved exactly by using the 'formatData' function.
formatData: function (data) {
return "{'featureClass': 'P', 'style': 'full', 'maxRows': '50'}";
}
jqxGrid Style
Properties
Appearance
altstart Number 1
altstep Number 1
columnsmenuwidth Number 15
everpresentrowheight Number 30
filterrowheight Number 31
statusbarheight Number 34
toolbarheight Number 34
Layout
columnsheight Number 30
deferreddatafields Array []
groupsheaderheight Number/String 34
groupindentwidth Number 20
pagerheight Number/String 34
rowsheight Number 28
scrollbarsize Number 15
Behavior
columns Array []
columngroups Array []
groups Array []
horizontalscrollbarstep Number 5
horizontalscrollbarlargestep Number 50
pagesize Number 10
pagerbuttonscount Number 5
selectedrowindex Number -1
selectedrowindexes Array []
source Object {}
sorttogglestates String 2
updatedelay Number 0
verticalscrollbarstep Number 5
Events
bindingcomplete Event
columnresized Event
columnreordered Event
columnclick Event
cellclick Event
celldoubleclick Event
cellselect Event
cellunselect Event
cellvaluechanged Event
cellbeginedit Event
cellendedit Event
filter Event
groupschanged Event
groupexpand Event
groupcollapse Event
pagechanged Event
pagesizechanged Event
rowclick Event
rowdoubleclick Event
rowselect Event
rowunselect Event
rowexpand Event
rowcollapse Event
sort Event
Methods
Common
autoresizecolumns Method
autoresizecolumn Method
beginupdate Method
clear Method
destroy Method
endupdate Method
ensurerowvisible Method
focus Method
getcolumnindex Method
getcolumn Method
getcolumnproperty Method
getrowid Method
getrowdata Method
getrowdatabyid Method
getrowboundindexbyid Method
getrowboundindex Method
getrows Method
getboundrows Method
getdisplayrows Method
getdatainformation Method
getsortinformation Method
getpaginginformation Method
hidecolumn Method
hideloadelement Method
hiderowdetails Method
iscolumnvisible Method
iscolumnpinned Method
localizestrings Method
pincolumn Method
refreshdata Method
refresh Method
render Method
scrolloffset Method
scrollposition Method
showloadelement Method
showrowdetails Method
setcolumnindex Method
setcolumnproperty Method
showcolumn Method
unpincolumn Method
updatebounddata Method
updating Method
Sorting(requires jqxgrid.sort.js)
getsortcolumn Method
removesort Method
sortby Method
Grouping(requires jqxgrid.grouping.js)
addgroup Method
cleargroups Method
collapsegroup Method
collapseallgroups Method
expandallgroups Method
expandgroup Method
getrootgroupscount Method
getgroup Method
insertgroup Method
iscolumngroupable Method
removegroupat Method
removegroup Method
Filtering(requires jqxgrid.filter.js)
addfilter Method
applyfilters Method
clearfilters Method
getfilterinformation Method
removefilter Method
refreshfilterrow Method
Paging(requires jqxgrid.pager.js)
gotopage Method
gotoprevpage Method
gotonextpage Method
Editing(requires jqxgrid.edit.js)
addrow Method
begincelledit Method
beginrowedit Method
closemenu Method
deleterow Method
endcelledit Method
endrowedit Method
getcell Method
getcellatposition Method
getcelltext Method
getcelltextbyid Method
getcellvaluebyid Method
getcellvalue Method
isBindingCompleted Method
openmenu Method
setcellvalue Method
setcellvaluebyid Method
showvalidationpopup Method
updaterow Method
Selection(requires jqxgrid.selection.js)
clearselection Method
getselectedrowindex Method
getselectedrowindexes Method
getselectedcell Method
getselectedcells Method
selectcell Method
selectallrows Method
selectrow Method
unselectrow Method
unselectcell Method
Aggregates(requires jqxgrid.aggregates.js)
getcolumnaggregateddata Method
refreshaggregates Method
renderaggregates Method
exportdata Method
getstate Method
loadstate Method
savestate Method