jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
46 lines (39 loc) • 1.56 kB
text/typescript
import { Component } from '@angular/core';
export class AppComponent {
source: any =
{
dataType: 'xml',
dataFields: [
{ name: 'SupplierName', type: 'string' },
{ name: 'Quantity', type: 'number' },
{ name: 'OrderDate', type: 'date' },
{ name: 'OrderAddress', type: 'string' },
{ name: 'Freight', type: 'number' },
{ name: 'Price', type: 'number' },
{ name: 'City', type: 'string' },
{ name: 'ProductName', type: 'string' },
{ name: 'Address', type: 'string' }
],
url: './../../../sampledata/orderdetailsextended.xml',
root: 'DATA',
record: 'ROW'
};
getWidth() : any {
if (document.body.offsetWidth < 850) {
return '90%';
}
return 850;
}
dataAdapter: any = new jqx.dataAdapter(this.source);
columns: any[] =
[
{ text: 'Supplier Name', cellsAlign: 'center', align: 'center', dataField: 'SupplierName', width: 300 },
{ text: 'Product', cellsAlign: 'center', align: 'center', dataField: 'ProductName', width: 300 },
{ text: 'Quantity', dataField: 'Quantity', cellsFormat: 'd2', aggregates: ['avg', 'min', 'max'], cellsAlign: 'center', align: 'center', width: 120 },
{ text: 'Price', dataField: 'Price', cellsFormat: 'c2', align: 'center', cellsAlign: 'center', aggregates: ['sum', 'min', 'max'] }
];
}