Available in the Full Version

Data Grid - Handling Remote Features Manually

Order IDOrder DateShip NameShip AddressTotal ItemsTotal Price

This sample is designed for a larger screen size.

On mobile, try rotating your screen, view full size, or email to another device.

This sample demonstrates how to handle remote features manually without relying on the IgniteUI MVC wrappers.
The remote features are handled on the server side in the GridRemoteData Action in the Controller.
When a specific action is applied to the grid (paging, filtering or sorting) a remote request will be send to the server with additional information stored in the Query String. On the server side, the feature specific parameters are extracted from the Query String and the related data operations are applied to the data. Once the data is fully proccessed the result is returned in JSON format to the client.

Code View

Copy to Clipboard
<!DOCTYPE html>

<html>
<head>
	<title></title>

	<!-- Ignite UI for jQuery Required Combined CSS Files -->
	<link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
	<link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />

	<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
	<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
	<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>

	<!-- Ignite UI for jQuery Required Combined JavaScript Files -->
	<script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
	<script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script>
</head>
<body>
	<script>
		$(function () {
			$("#grid").igGrid({
				autogenerateColumns: false,
				responseDataKey: "Records",
				height: 500,
				width: "100%",
				dataSource: "@(Url.Action("GridRemoteData"))",
				columns: [{
					key: 'OrderID',
					dataType: 'number',
					headerText: 'Order ID',
					width: '10%'
				}, {
					key: 'OrderDate',
					dataType: 'date',
					headerText: 'Order Date',
					width: '15%'
				}, {
					key: 'ShipName',
					dataType: 'string',
					headerText: 'Ship Name',
					width: '20%'
				}, {
					key: 'ShipAddress',
					dataType: 'string',
					headerText: 'Ship Address',
					width: '25%'
				}, {
					key: 'TotalItems',
					dataType: 'number',
					headerText: 'Total Items',
					width: '10%'
				}, {
					key: 'TotalPrice',
					dataType: 'number',
					headerText: 'Total Price',
					width: '15%'
				}],
				features: [
					{ name: "Paging", type: "remote", recordCountKey: "TotalRecordsCount" },
					{
						name: "Sorting", type: "remote",
						sortUrlKey: 'sort',
						sortUrlKeyAscValue: 'asc',
						sortUrlKeyDescValue: 'desc'
					},
					{ name: "Filtering", type: "remote", filterExprUrlKey: "filter" }
				]
			});
		});
	</script>
	<table id="grid"></table>
</body>
</html>