jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
66 lines (60 loc) • 3.27 kB
HTML
<html lang="en">
<head>
<title id='Description'>Custom Element DataTable XMLData</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<meta name="description" content="This is an example of XML data in Angular DataTable" />
<link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet" href="../../../styles/demos.css" type="text/css" />
<script type="text/javascript" src="../../../scripts/webcomponents-lite.min.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcore.elements.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdata.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdatatable.js"></script>
<script type="text/javascript" src="../../sampledata/generatedata.js"></script>
<script type="text/javascript" src="../../../scripts/demos.js"></script>
<script type="text/javascript">
var source =
{
datatype: 'xml',
datafields: [
{ name: 'CompanyName', map: 'm\\:properties>d\\:CompanyName', type: 'string' },
{ name: 'ContactName', map: 'm\\:properties>d\\:ContactName', type: 'string' },
{ name: 'ContactTitle', map: 'm\\:properties>d\\:ContactTitle', type: 'string' },
{ name: 'City', map: 'm\\:properties>d\\:City', type: 'string' },
{ name: 'PostalCode', map: 'm\\:properties>d\\:PostalCode', type: 'string' },
{ name: 'Country', map: 'm\\:properties>d\\:Country', type: 'string' }
],
root: 'entry',
record: 'content',
id: 'm\\:properties>d\\:CustomerID',
url: '../../sampledata/customers.xml'
};
var dataAdapter = new jqx.dataAdapter(source);
JQXElements.settings['dataTableSettings'] =
{
source: dataAdapter,
pageable: true,
pagerButtonsCount: 10,
columnsResize: true,
columns: [
{ text: 'Company Name', datafield: 'CompanyName', width: 250 },
{ text: 'Contact Name', datafield: 'ContactName', width: 250 },
{ text: 'Contact Title', datafield: 'ContactTitle', width: 250 },
{ text: 'City', datafield: 'City', width: 120 },
{ text: 'Postal Code', datafield: 'PostalCode', width: 90 },
{ text: 'Country', datafield: 'Country', width: 100 }
]
}
</script>
</head>
<body>
<div class="example-description">
Data Binding to XML data in Custom element DataTable.
</div>
<jqx-data-table settings="dataTableSettings"></jqx-data-table>
</body>
</html>