JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://jp.igniteui.com/js/modernizr.min.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/i18n/infragistics-ja.js"></script>
<ul id="tree"></ul>
JavaScript
$(function () {
//Sample XML Data
var xmlDoc = '<OrgChart Name="全社員">' +
'<Employee Name="Gustavo Achong" Age="42" Email="[email protected]">' +
'<Employee Name="Kim Abercrombie" Age="33" Email="[email protected]" />' +
'<Employee Name="Lawrence Tapley" Age="52" Email="[email protected]" />' +
'</Employee>' +
'<Employee Name="Catherine Abel" Age="27" Email="[email protected]">' +
'<Employee Name="Kristen Anderson" Age="30" Email="[email protected]" />' +
'<Employee Name="Richard Lee" Age="25" Email="[email protected]" />' +
'<Employee Name="Victoria Gramley" Age="23" Email="[email protected]" />' +
'</Employee>' +
'<Employee Name="Adrienne Mauro" Age="27" Email="[email protected]">' +
'<Employee Name="Christopher Chadwick" Age="37" Email="[email protected]" />' +
'</Employee>' +
'</OrgChart>';
//Binding to XML requires a schema to define data fields
var xmlSchema = new $.ig.DataSchema("xml",
{
//searchField serves as the base node(s) for the XPaths
searchField: "OrgChart",
childDataProperty: "Employee",
fields: [
{ name: "Name", xpath: "@Name" },
{ name: "Age", xpath: "@Age" },
{ name: "Email", xpath: "@Email" },
{ name: "Employee", xpath: "Employee" }
]
}
);
//This creates an Infragistics datasource from the XML
//and the Schema which can be consumed by the grid.
var ds = new $.ig.DataSource({
type: "xml",
...