jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
45 lines (39 loc) • 1.57 kB
text/typescript
import { Component } from '@angular/core';
export class AppComponent {
source: any =
{
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'
};
getWidth() : any {
if (document.body.offsetWidth < 850) {
return '90%';
}
return 850;
}
dataAdapter: any = new jqx.dataAdapter(this.source);
columns: any[] =
[
{ text: 'Company Name', datafield: 'CompanyName', width: 250 },
{ text: 'Contact Name', datafield: 'ContactName', width: 150 },
{ text: 'Contact Title', datafield: 'ContactTitle', width: 180 },
{ text: 'City', datafield: 'City', width: 120 },
{ text: 'Postal Code', datafield: 'PostalCode', width: 90 },
{ text: 'Country', datafield: 'Country', width: 100 }
];
}