jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
59 lines (49 loc) • 1.71 kB
text/typescript
import { Component, ViewChild } from '@angular/core';
import { jqxTreeGridComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxtree';
export class AppComponent {
getWidth() : any {
if (document.body.offsetWidth < 850) {
return '90%';
}
return 850;
}
source: any =
{
dataType: "csv",
dataFields: [
{ name: 'EmployeeKey', type: 'number' },
{ name: 'ParentEmployeeKey', type: 'number' },
{ name: 'FirstName', type: 'string' },
{ name: 'LastName', type: 'string' },
{ name: 'Title', type: 'string' },
{ name: 'HireDate', type: 'date' },
{ name: 'BirthDate', type: 'date' },
{ name: 'Phone', type: 'string' },
{ name: 'Gender', type: 'string' },
{ name: 'DepartmentName', type: 'string' }
],
hierarchy:
{
keyDataField: { name: 'EmployeeKey' },
parentDataField: { name: 'ParentEmployeeKey' }
},
id: 'EmployeeKey',
url: '../assets/employeesadv.txt'
};
dataAdapter: any = new jqx.dataAdapter(this.source);
columns: any[] = [
{ text: 'FirstName', dataField: 'FirstName', minWidth: 100, width: 200 },
{ text: 'LastName', dataField: 'LastName', width: 200 },
{ text: 'Department Name', dataField: 'DepartmentName', width: 200 },
{ text: 'Title', dataField: 'Title' }
];
ready(): void {
this.treeGrid.expandRow(32);
this.treeGrid.expandRow(73);
};
}