<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- 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>
<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>
</head>
<body>
<table id="table" class="standard-grid">
<thead>
<tr>
<th>
名前
</th>
<th>
メール
</th>
<th>
年齢
</th>
</tr>
</thead>
<tbody></tbody>
</table>
<script src="/TypeScriptSamples/data-source/typescript.js"></script>
</body>
</html>
/// <reference path="/js/typings/jquery.d.ts" />
/// <reference path="/js/typings/jqueryui.d.ts" />
/// <reference path="/js/typings/igniteui.d.ts" />
class PersonData {
name: string;
email: string;
age: number;
constructor(inName: string, inEmail: string, inAge: number) {
this.name = inName;
this.email = inEmail;
this.age = inAge;
}
}
var people: PersonData[] = [];
people.push(new PersonData("Gustavo Achong", "gachong@adventureworks.com", 45));
people.push(new PersonData("Catherine Abel", "cabel@adventureworks.com", 32));
people.push(new PersonData("Kim Abercrombie", "kabercrombie@adventureworks.com", 27));
$(function () {
// Renders the table
var renderTable = function (success, error) {
var template = "<tr><td>${name}</td><td>${email}</td><td>${age}</td></tr>";
if (success) {
$("#table tbody").empty();
$($.ig.tmpl(template, ds.dataView())).appendTo("#table tbody");
} else {
alert(error);
}
}
//This code creates an $.ig.DataSource
var ds = new $.ig.DataSource({
dataSource: people,
callback: renderTable
});
// Binds to the underlying data
ds.dataBind();
});