<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
.standard-grid { width:100%; border-top:1px solid #b1b1b1; border-right:1px solid #b1b1b1; border-spacing: 0;}
.standard-grid th, .standard-grid td { text-align:left; border-bottom:1px solid #b1b1b1; border-left:1px solid #b1b1b1; padding:4px;}
</style>
<!-- Ignite UI for jQuery Required Combined CSS Files -->
<link href="http://cdn-na.infragistics.com/igniteui/2024.1/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="http://cdn-na.infragistics.com/igniteui/2024.1/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.1/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2024.1/latest/js/infragistics.lob.js"></script>
</head>
<body>
<table id="table" class="standard-grid">
<thead>
<tr>
<th>
Image
</th>
<th>
Name
</th>
<th>
Notes
</th>
</tr>
</thead>
<tbody></tbody>
</table>
<br />
<script>
$(function () {
// Renders the table
var renderTable = function (success, error) {
var template = "<tr><td><img width='90' height='100' src='${ImageUrl}' /img></td></td><td>${Name}</td><td>{{html Notes}}</td></tr>";
if (success) {
$("#table tbody").empty();
$($.ig.tmpl(template, ds.dataView())).appendTo("#table tbody");
} else {
alert(error);
}
}
// The $.ig.DataSchema is used to define the schema of the data
var oDataSchema = new $.ig.DataSchema("json", {
fields: [
{ name: "Name" },
{ name: "ImageUrl" },
{ name: "Notes" }
],
searchField: "d.results"
});
// service Url
var url = "https://www.igniteui.com/api/employees?callback=?";
// This code creates an $.ig.DataSource bound to oData service
var ds = new $.ig.DataSource({
type: "remoteUrl",
callback: renderTable,
dataSource: url,
schema: oDataSchema,
responseDataKey: "d.results",
responseDataType: "jsonp",
responseContentType: "application/json; charset=utf-8"
});
// Binds to the underlying data
ds.dataBind();
});
</script>
</body>
</html>