Ignite UI jQuery Grid gallery row template
by paska
HTML
<script src="http://igniteui.com/js/modernizr.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="http://www.igniteui.com/igniteui/js/infragistics.core.js"></script>
<script src="http://www.igniteui.com/igniteui/js/infragistics.lob.js"></script>
<link href="http://www.igniteui.com/igniteui/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="http://www.igniteui.com/igniteui/css/structure/infragistics.css" rel="stylesheet"></link>
<table id="grid"></table>
JavaScript
$(function () {
var employees = getEmployees();
try {
$("#grid").igGrid({
dataSource: employees,
autoGenerateColumns: false,
width: "100%",
columns: [{
headerText: "ID",
key: "ID",
hidden: true,
dataType: "number"
}, {
headerText: "Name",
key: "Name",
dataType: "string",
width: "*"
}, {
headerText: "Address",
key: "Address",
dataType: "string",
width: "*"
}]
});
}
catch (ex) {
alert ("Error: " + ex.message());
}
function getEmployees() {
//from http://igniteui.com/api/employees?callback=?
return [{
"ID": 1,
"Name": "Nancy Davolio",
"Title": "Sales Representative",
"TitleOfCourtesy": "Ms.",
"BirthDate": "12/8/1948",
"HireDate": "5/1/1992",
"Address": "507 - 20th Ave. E.\r\nApt. 2A",
"City": "Seattle",
"Region": "WA",
"PostalCode": "98122",
"Country": "USA",
"HomePhone": "(206) 555-9857",
"Extension": "5467",
"Notes": "Education includes a BA in psychology from Colorado State University in 1970. She also completed \"The Art of the Cold Call.\" Nancy is a member of Toastmasters International.",
"Supervisor": "Andrew Fuller",
"ImageUrl": "http://igniteui.com/images/samples/nw/employees/1.png",
"Employees": []
}, {
"ID": 2,
"Name": "Andrew Fuller",
"Title": "Vice President, Sales",
"TitleOfCourtesy": "Dr.",
"BirthDate": "2/19/1952",
"HireDate": "8/14/1992",
...