import { Component, ViewChild, ViewEncapsulation, ElementRef, AfterViewInit } from '@angular/core';
import { jqxSortableComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxsortable';
import { jqxPanelComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxpanel';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['app.component.css'],
encapsulation: ViewEncapsulation.None
})
export class AppComponent implements AfterViewInit {
@ViewChild('sortable') sortable: jqxSortableComponent;
@ViewChild('eventsContainer') eventsContainer: jqxPanelComponent;
ngAfterViewInit() {
this.loadInfo();
}
loadInfo(): void {
let firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven"];
let lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan"];
let titles = ["Sales Representative", "Vice President, Sales", "Sales Representative", "Sales Representative", "Sales Manager"];
for (let i = 0; i < firstNames.length; i++) {
let element = document.createElement('div');
let imgurl = 'https://www.jqwidgets.com/angular/images/' + firstNames[i].toLowerCase() + '.png';
let img = '';
element.innerHTML = '
| ' + img + ' | ' + firstNames[i] + " " + lastNames[i] + ' |
| ' + titles[i] + ' |