Available in the Full Version

Data Grid - Performance

The igGrid control provides several options and features that increase its performance.
  • The Virtualization feature improves rendering time if the grid has a large set of records.
  • The remote Paging feature allows the grid to request its data from the server in small chunks per page.
  • The remote Filtering feature executes the search operation on the server and returns the result to the client.
5000
10
IDFirst NameLast NameCompanyEmailPositionAgeAddressPhonePicture
 
1PeterTaylorApplePeterTaylor@Apple.comQA18USA+12345PeterTaylor.jpg
2MeganClarkAppleMeganClark@Apple.comCEO57Canada+22345MeganClark.jpg
3JohnWilsonMicrosoftJohnWilson@Microsoft.comProject Manager48Great Britain+32345JohnWilson.jpg
4LizBrownInfragisticsLizBrown@Infragistics.comQA32Great Britain+42345LizBrown.jpg
5DavidBrownAppleDavidBrown@Apple.comDev26Great Britain+52345DavidBrown.jpg
6DavidTaylorAppleDavidTaylor@Apple.comQA31Canada+62345DavidTaylor.jpg
7DavidBrownInfragisticsDavidBrown@Infragistics.comQA57Canada+72345DavidBrown.jpg
8JohnTaylorInfragisticsJohnTaylor@Infragistics.comCEO28Great Britain+82345JohnTaylor.jpg
9AlisonWilsonAppleAlisonWilson@Apple.comProject Manager23USA+92345AlisonWilson.jpg
10MeganRobinsonAppleMeganRobinson@Apple.comDev50Great Britain+102345MeganRobinson.jpg
11JenniferMitchelMicrosoftJenniferMitchel@Microsoft.comQA25Canada+112345JenniferMitchel.jpg
12JohnSmithMicrosoftJohnSmith@Microsoft.comCEO27Great Britain+122345JohnSmith.jpg
13ThomasMitchelAppleThomasMitchel@Apple.comQA46USA+132345ThomasMitchel.jpg
14JohnSmithInfragisticsJohnSmith@Infragistics.comQA27Canada+142345JohnSmith.jpg
15LizDavisInfragisticsLizDavis@Infragistics.comDev43USA+152345LizDavis.jpg
16DavidClarkInfragisticsDavidClark@Infragistics.comQA55USA+162345DavidClark.jpg
17PaulJonesApplePaulJones@Apple.comCEO25Great Britain+172345PaulJones.jpg
18PeterMitchelInfragisticsPeterMitchel@Infragistics.comCEO43Great Britain+182345PeterMitchel.jpg
19MartinBrownAppleMartinBrown@Apple.comProject Manager31USA+192345MartinBrown.jpg
20PaulBrownMicrosoftPaulBrown@Microsoft.comProject Manager42Great Britain+202345PaulBrown.jpg
21PeterRobinsonApplePeterRobinson@Apple.comProject Manager50Great Britain+212345PeterRobinson.jpg
22GeorgeJonesInfragisticsGeorgeJones@Infragistics.comDev27Canada+222345GeorgeJones.jpg
23MartinSmithInfragisticsMartinSmith@Infragistics.comDev25USA+232345MartinSmith.jpg
24PaulJohnsonMicrosoftPaulJohnson@Microsoft.comCEO36Great Britain+242345PaulJohnson.jpg
25JohnJonesMicrosoftJohnJones@Microsoft.comCEO26USA+252345JohnJones.jpg
26LindaJonesAppleLindaJones@Apple.comCEO40Canada+262345LindaJones.jpg
27LindaRobinsonInfragisticsLindaRobinson@Infragistics.comCEO23Canada+272345LindaRobinson.jpg
28BobTaylorMicrosoftBobTaylor@Microsoft.comProject Manager42Canada+282345BobTaylor.jpg
29GeorgeBrownInfragisticsGeorgeBrown@Infragistics.comCEO50Canada+292345GeorgeBrown.jpg
30JohnDavisInfragisticsJohnDavis@Infragistics.comCEO40USA+302345JohnDavis.jpg
31GeorgeBrownMicrosoftGeorgeBrown@Microsoft.comProject Manager36USA+312345GeorgeBrown.jpg
32BobDavisInfragisticsBobDavis@Infragistics.comCEO44USA+322345BobDavis.jpg
33MartinBrownMicrosoftMartinBrown@Microsoft.comDev44Canada+332345MartinBrown.jpg
34PeterWilsonApplePeterWilson@Apple.comCEO40USA+342345PeterWilson.jpg
35AlisonSmithMicrosoftAlisonSmith@Microsoft.comQA24USA+352345AlisonSmith.jpg
36AlisonClarkInfragisticsAlisonClark@Infragistics.comProject Manager47Great Britain+362345AlisonClark.jpg
37MartinSmithInfragisticsMartinSmith@Infragistics.comQA24Great Britain+372345MartinSmith.jpg
38AlanMillerAppleAlanMiller@Apple.comProject Manager55Canada+382345AlanMiller.jpg
39ThomasRobinsonAppleThomasRobinson@Apple.comProject Manager18Great Britain+392345ThomasRobinson.jpg
40AlisonClarkMicrosoftAlisonClark@Microsoft.comDev52Canada+402345AlisonClark.jpg
41AlisonWilsonAppleAlisonWilson@Apple.comQA26Canada+412345AlisonWilson.jpg
42MeganTaylorMicrosoftMeganTaylor@Microsoft.comDev34Canada+422345MeganTaylor.jpg
43MartinClarkInfragisticsMartinClark@Infragistics.comCEO38Great Britain+432345MartinClark.jpg
44LindaBrownAppleLindaBrown@Apple.comQA27Great Britain+442345LindaBrown.jpg
45LizTaylorInfragisticsLizTaylor@Infragistics.comCEO33USA+452345LizTaylor.jpg
46DavidKingAppleDavidKing@Apple.comDev31USA+462345DavidKing.jpg
47BobWilsonMicrosoftBobWilson@Microsoft.comProject Manager53Canada+472345BobWilson.jpg
48JohnBrownInfragisticsJohnBrown@Infragistics.comProject Manager42Canada+482345JohnBrown.jpg
49LizJonesAppleLizJones@Apple.comDev34USA+492345LizJones.jpg
50JohnJohnsonInfragisticsJohnJohnson@Infragistics.comCEO53Canada+502345JohnJohnson.jpg
51MartinTaylorInfragisticsMartinTaylor@Infragistics.comProject Manager32Canada+512345MartinTaylor.jpg
52MartinSmithMicrosoftMartinSmith@Microsoft.comDev49Canada+522345MartinSmith.jpg
53AlisonKingAppleAlisonKing@Apple.comProject Manager45USA+532345AlisonKing.jpg
54MartinClarkAppleMartinClark@Apple.comDev35Great Britain+542345MartinClark.jpg
55AlisonTaylorAppleAlisonTaylor@Apple.comQA58Great Britain+552345AlisonTaylor.jpg
56ThomasBrownInfragisticsThomasBrown@Infragistics.comProject Manager33Great Britain+562345ThomasBrown.jpg
57AlanTaylorMicrosoftAlanTaylor@Microsoft.comProject Manager32Great Britain+572345AlanTaylor.jpg
58PeterBrownInfragisticsPeterBrown@Infragistics.comCEO46USA+582345PeterBrown.jpg
59LindaBrownAppleLindaBrown@Apple.comQA26Canada+592345LindaBrown.jpg
60AlisonMillerAppleAlisonMiller@Apple.comCEO26Great Britain+602345AlisonMiller.jpg
61DavidWilsonInfragisticsDavidWilson@Infragistics.comQA54Great Britain+612345DavidWilson.jpg
62PeterJonesInfragisticsPeterJones@Infragistics.comQA44Canada+622345PeterJones.jpg
63MaryMitchelInfragisticsMaryMitchel@Infragistics.comProject Manager59Canada+632345MaryMitchel.jpg
64JenniferJonesInfragisticsJenniferJones@Infragistics.comCEO23USA+642345JenniferJones.jpg
65AlanRobinsonInfragisticsAlanRobinson@Infragistics.comQA57Great Britain+652345AlanRobinson.jpg
66MartinRobinsonAppleMartinRobinson@Apple.comCEO50Canada+662345MartinRobinson.jpg
67JenniferRobinsonMicrosoftJenniferRobinson@Microsoft.comDev48Great Britain+672345JenniferRobinson.jpg
68PaulWilsonInfragisticsPaulWilson@Infragistics.comCEO59USA+682345PaulWilson.jpg
69AlanJohnsonAppleAlanJohnson@Apple.comCEO18Great Britain+692345AlanJohnson.jpg
70AlisonKingAppleAlisonKing@Apple.comProject Manager55USA+702345AlisonKing.jpg
71LindaDavisInfragisticsLindaDavis@Infragistics.comCEO32Great Britain+712345LindaDavis.jpg
72AlisonWilsonMicrosoftAlisonWilson@Microsoft.comProject Manager35Great Britain+722345AlisonWilson.jpg
73MaryKingAppleMaryKing@Apple.comQA40Canada+732345MaryKing.jpg
74GeorgeJohnsonAppleGeorgeJohnson@Apple.comQA43Great Britain+742345GeorgeJohnson.jpg
75LindaRobinsonAppleLindaRobinson@Apple.comProject Manager23USA+752345LindaRobinson.jpg
76JohnKingMicrosoftJohnKing@Microsoft.comCEO45Great Britain+762345JohnKing.jpg
77PaulMillerMicrosoftPaulMiller@Microsoft.comDev34USA+772345PaulMiller.jpg
78JenniferMitchelMicrosoftJenniferMitchel@Microsoft.comDev21USA+782345JenniferMitchel.jpg
79MaryDavisAppleMaryDavis@Apple.comProject Manager22Canada+792345MaryDavis.jpg
80MartinWilsonInfragisticsMartinWilson@Infragistics.comQA31Great Britain+802345MartinWilson.jpg
81JenniferJonesAppleJenniferJones@Apple.comDev44Canada+812345JenniferJones.jpg
82GeorgeJohnsonInfragisticsGeorgeJohnson@Infragistics.comCEO52Canada+822345GeorgeJohnson.jpg
83PeterDavisInfragisticsPeterDavis@Infragistics.comProject Manager33Canada+832345PeterDavis.jpg
84MeganRobinsonMicrosoftMeganRobinson@Microsoft.comCEO59USA+842345MeganRobinson.jpg
85GeorgeJonesInfragisticsGeorgeJones@Infragistics.comDev40Great Britain+852345GeorgeJones.jpg
86MeganDavisMicrosoftMeganDavis@Microsoft.comProject Manager22Great Britain+862345MeganDavis.jpg
87LizWilsonInfragisticsLizWilson@Infragistics.comProject Manager38Canada+872345LizWilson.jpg
88PeterJonesApplePeterJones@Apple.comQA33Canada+882345PeterJones.jpg
89MaryMillerMicrosoftMaryMiller@Microsoft.comCEO23USA+892345MaryMiller.jpg
90DavidJohnsonInfragisticsDavidJohnson@Infragistics.comProject Manager31Great Britain+902345DavidJohnson.jpg
91JohnTaylorInfragisticsJohnTaylor@Infragistics.comDev36USA+912345JohnTaylor.jpg
92MaryJonesMicrosoftMaryJones@Microsoft.comProject Manager30Canada+922345MaryJones.jpg
93JohnJohnsonInfragisticsJohnJohnson@Infragistics.comDev57Canada+932345JohnJohnson.jpg
94PeterMitchelApplePeterMitchel@Apple.comQA26Canada+942345PeterMitchel.jpg
95AlisonSmithInfragisticsAlisonSmith@Infragistics.comDev37Great Britain+952345AlisonSmith.jpg
96ThomasClarkAppleThomasClark@Apple.comCEO45USA+962345ThomasClark.jpg
97PeterJohnsonApplePeterJohnson@Apple.comCEO52USA+972345PeterJohnson.jpg
98JenniferJohnsonMicrosoftJenniferJohnson@Microsoft.comCEO38Canada+982345JenniferJohnson.jpg
99GeorgeJonesInfragisticsGeorgeJones@Infragistics.comCEO23Great Britain+992345GeorgeJones.jpg
100AlanMillerAppleAlanMiller@Apple.comQA53Canada+1002345AlanMiller.jpg
101AlisonJonesInfragisticsAlisonJones@Infragistics.comDev38USA+1012345AlisonJones.jpg
102ThomasJohnsonMicrosoftThomasJohnson@Microsoft.comQA43Canada+1022345ThomasJohnson.jpg
103LindaMitchelAppleLindaMitchel@Apple.comCEO39USA+1032345LindaMitchel.jpg
104AlisonClarkMicrosoftAlisonClark@Microsoft.comCEO29USA+1042345AlisonClark.jpg
105GeorgeKingAppleGeorgeKing@Apple.comProject Manager39Canada+1052345GeorgeKing.jpg
106DavidSmithAppleDavidSmith@Apple.comDev53Great Britain+1062345DavidSmith.jpg
107PeterMitchelMicrosoftPeterMitchel@Microsoft.comQA58Canada+1072345PeterMitchel.jpg
108PaulRobinsonInfragisticsPaulRobinson@Infragistics.comDev21Canada+1082345PaulRobinson.jpg
109PaulMitchelInfragisticsPaulMitchel@Infragistics.comCEO59USA+1092345PaulMitchel.jpg
110BobDavisInfragisticsBobDavis@Infragistics.comDev52Great Britain+1102345BobDavis.jpg
111MartinKingMicrosoftMartinKing@Microsoft.comQA59Great Britain+1112345MartinKing.jpg
112LindaKingInfragisticsLindaKing@Infragistics.comQA30Canada+1122345LindaKing.jpg
113BobTaylorMicrosoftBobTaylor@Microsoft.comQA22Canada+1132345BobTaylor.jpg
114LizMitchelAppleLizMitchel@Apple.comCEO30USA+1142345LizMitchel.jpg
115MaryDavisInfragisticsMaryDavis@Infragistics.comCEO53USA+1152345MaryDavis.jpg
116DavidClarkInfragisticsDavidClark@Infragistics.comProject Manager24Great Britain+1162345DavidClark.jpg
117GeorgeKingAppleGeorgeKing@Apple.comDev41Canada+1172345GeorgeKing.jpg
118GeorgeClarkAppleGeorgeClark@Apple.comQA35Great Britain+1182345GeorgeClark.jpg
119AlanMitchelAppleAlanMitchel@Apple.comQA48Canada+1192345AlanMitchel.jpg
API Viewer
The whole grid was rendered for : 0.72 seconds.
Rows rendered for : 0.034 seconds.
Data fetched for : 0.642 seconds.

This sample is designed for a larger screen size.

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

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>
	<!-- Used to add markup and provide logging
	functionality for the API Explorer and API Viewer UI -->
	<script src="/js/apiviewer.js"></script>
	<style>
		.s-clearfix {
			content: "";
			display: table;
			clear: both;
		}

		.w100 {
			width: 100%;
		}

		.w33 {
			width: 33.3%;
		}

		.mb10 {
			margin-bottom: 10px;
		}

		.ml5 {
			margin-left: 5px;
		}

		.min-173 {
			min-width: 173px;
		}

		.pr30 {
			padding-right:30px;
		}

		.border-box {
			box-sizing: border-box;
		}

		.igui-filter-f-left {
			float: left;
		}

		.igui-filter-f-right {
			float: right;
		}

		.igui-filter-modul {
			margin: 0 0 15px 0;
			border:1px solid  #f1f1f1;
			padding: 10px;
		}

		.igui-filter-section {
			margin-bottom: 20px;
		}

		.d-block {
			display: block;
		}

		.igui-filter-checkbox label  {
			cursor: pointer;
		}
	</style>
</head>
<body>
	<div class="w100 igui-filter-section s-clearfix">

		<div class="w33 min-173 pr30 border-box igui-filter-f-left">
			<div class="igui-filter-modul">
				<div class="mb10 w100 s-clearfix">
					<label class="igui-filter-f-left">Rows Count: </label>
					<span class="igui-filter-f-right" id="rowsLbl">5000</span>
				</div>
				<div id="dataCount"></div>
			</div>

			<div class="igui-filter-modul">
				<div class="mb10 w100 s-clearfix">
					<label class="igui-filter-f-left">Columns Count: </label>
					<span class="igui-filter-f-right" id="colsLbl">10</span>
				</div>
				<div id="colCount"></div>
			</div>
		</div>

		<div class="min-173 w33 pr30 border-box igui-filter-f-left igui-filter-checkbox">
			<div class="mb10 s-clearfix">
				<input class="mr5 igui-filter-f-left" id="pagingCheck" type="checkbox"/>
				<label class="ml5 igui-filter-f-right" for="pagingCheck">Enable Paging </label>

			</div>
			<div class="mb10 s-clearfix">
				<input class="igui-filter-f-left" id="filteringCheck" type="checkbox" />
				<label class="ml5 igui-filter-f-right" for="filteringCheck">Enable Filtering </label>
			</div>
			<div class="mb10">
				<label class="mb10 d-block" for="virt">Virtualization Type: </label>
				<input id="virt" type="text" />
			</div>
		</div>

		<div class="w33 igui-filter-f-left">
			
			<div>
				<button id="btnRefresh" type="button">Rebind the grid</button>
			</div>
		</div>
	</div>
	<table id="grid"></table>
	<div class="api-viewer"></div>
	<script>
		var apiViewer = new $.ig.apiViewer();

		$(function () {
			var dataBind = true,
				startRender,
				endRender,
				rowsRendering,
				rowsRendered,
				dataFetching,
				dataFetched,
				filtering,
				paging,
				virt,
				opts = {};

			function setUpOptions(virt, paging, filtering, colCount) {
				var opts = {}, columns = [], features = [], cols;

				columns.push({ headerText: "ID", key: "ID", dataType: "number", width: "200px" });
				columns.push({ headerText: "First Name", key: "FirstName", dataType: "string", width: "200px" });
				columns.push({ headerText: "Last Name", key: "LastName", dataType: "string", width: "200px" });
				columns.push({ headerText: "Company", key: "Company", dataType: "string", width: "200px" });
				columns.push({ headerText: "Email", key: "Email", dataType: "string", width: "200px" });
				columns.push({ headerText: "Position", key: "Position", dataType: "string", width: "200px" });
				columns.push({ headerText: "Age", key: "Age", dataType: "number", width: "200px" });
				columns.push({ headerText: "Address", key: "Address", dataType: "string", width: "200px" });
				columns.push({ headerText: "Phone", key: "Phone", dataType: "string", width: "200px" });
				columns.push({ headerText: "Picture", key: "Picture", dataType: "string", width: "200px" });
				columns.push({ headerText: "Is Active", key: "IsActive", dataType: "bool", width: "200px" });
				columns.push({ headerText: "Balance", key: "Balance", dataType: "string", width: "200px" });
				columns.push({ headerText: "Eye Color", key: "EyeColor", dataType: "string", width: "200px" });
				columns.push({ headerText: "Registered", key: "Registered", dataType: "bool", width: "200px" });
				columns.push({ headerText: "Latitude", key: "Latitude", dataType: "number", width: "200px" });
				columns.push({ headerText: "Longitude", key: "Longitude", dataType: "number", width: "200px" });
				columns.push({ headerText: "Tags", key: "Tags", dataType: "string", width: "200px" });
				columns.push({ headerText: "Greeting", key: "Greeting", dataType: "string", width: "200px" });
				columns.push({ headerText: "GUID", key: "GUID", dataType: "string", width: "200px" });
				columns.push({ headerText: "Index", key: "Index", dataType: "number", width: "200px" });

				cols = columns.slice(0, colCount);
				opts["columns"] = cols;
				opts["responseDataKey"] = "d.results.Records";
				opts["responseTotalRecCountKey"] = "d.results.TotalRecordsCount";

				opts["autoGenerateColumns"] = false;
				opts["dataSource"] = "https://www.igniteui.com/api/gridperformance?callback=?";

				if (virt !== "none") {
					opts["rowVirtualization"] = true;
					opts["virtualizationMode"] = virt;
				};
				opts["width"] = "100%";
				opts["height"] = "500px";
				if (paging) {
					features.push({ name: "Paging", type: "remote", pageIndexUrlKey: "page", pageSizeUrlKey: "pageSize", recordCountKey: "d.results.TotalRecordsCount" });
				}
				if (filtering) {
					features.push({ name: "Filtering", type: "remote", filterExprUrlKey: "filter" });
				}
				opts["features"] = features;

				opts["rendering"] = function (evt, ui) {
					startRender = new Date().getTime();
				};

				opts["rendered"] = function (evt, ui) {
					endRender = new Date().getTime();
					apiViewer.log("The whole grid was rendered for : " + (endRender - startRender) / 1000 + " seconds.");
					apiViewer.log("");
				};

				opts["rowsRendering"] = function (evt, ui) {
					rowsRendering = new Date().getTime();
				};

				opts["rowsRendered"] = function (evt, ui) {
					rowsRendered = new Date().getTime();
					apiViewer.log("Rows rendered for : " + (rowsRendered - rowsRendering) / 1000 + " seconds.");
				};

				opts["dataBinding"] = function (evt, ui) {
					dataFetching = new Date().getTime();
				};

				opts["dataBound"] = function (evt, ui) {
					dataFetched = new Date().getTime();
					apiViewer.log("Data fetched for : " + (dataFetched - dataFetching) / 1000 + " seconds.");
				};

				return opts;
			}

			$.ajaxSetup({
				beforeSend: function (jq, settings) {
					var rowsCount = $("#dataCount").slider("value"),
						colsCount = $("#colCount").slider("value"),
						filtering = $("#filteringCheck").igCheckboxEditor("value"),
						paging = $("#pagingCheck").igCheckboxEditor("value"),
						virt = $("#virt").igCombo("value");
					if (settings.url.indexOf("api/gridperformance") !== -1) {
						settings.url += "&rowscount=" + rowsCount;
						settings.url += "&databind=" + dataBind;
						settings.url += "&colscount=" + colsCount;
						if (settings.url.indexOf("pageIndex") !== -1 || settings.url.indexOf("filter") !== -1) {
							dataBind = false;
						}
					}
				},
			});

			$("#dataCount").slider({
				min: 1000,
				max: 20000,
				step: 1000,
				value: 5000,
				slide: function (event, ui) {
					$("#rowsLbl").html(ui.value);
				}
			});
			$("#colCount").slider({
				min: 1,
				max: 20,
				step: 1,
				value: 10,
				slide: function (event, ui) {
					$("#colsLbl").html(ui.value);
				}
			});
			$("#btnRefresh").igButton({
				click: function (evt, args) {
					dataBind = true;
					filtering = $("#filteringCheck").igCheckboxEditor("value");
					paging = $("#pagingCheck").igCheckboxEditor("value");
					virt = $("#virt").igCombo("value");
					colsCount = $("#colCount").slider("value");
					opts = setUpOptions(virt, paging, filtering, colsCount);
					$(evt.target).igButton("option", "disabled", true);
					$("#grid").igGrid("destroy");
					opts.dataBound = function () {
						$(evt.target).igButton("option", "disabled", false);
					};
					$("#grid").igGrid(opts);
				}
			});
			$("#virt").igCombo({
				dataSource: [
					"continuous",
					"none",
					"fixed"
				],
				mode: "dropdown"
			});
			$("#pagingCheck").igCheckboxEditor();

			$("#filteringCheck").igCheckboxEditor();

			filtering = $("#filteringCheck").igCheckboxEditor("value");
			paging = $("#pagingCheck").igCheckboxEditor("value");
			virt = $("#virt").igCombo("value");
			colsCount = $("#colCount").slider("value");
			opts = setUpOptions(virt, paging, filtering, colsCount);

			$("#grid").igGrid(opts);
		});

	</script>
</body>
</html>