jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
43 lines (35 loc) • 1.36 kB
text/typescript
import { Component, ViewChild, ElementRef } from '@angular/core';
({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
('log', { static: false }) log: ElementRef;
source: any = {
datatype: 'xml',
datafields: [
{ name: 'CompanyName', map: 'm\\:properties>d\\:CompanyName' },
{ name: 'ContactName', map: 'm\\:properties>d\\:ContactName' },
],
root: 'entry',
record: 'content',
id: 'm\\:properties>d\\:CustomerID',
url: './../../../sampledata/customers.xml'
};
dataAdapter: any = new jqx.dataAdapter(this.source);
listOnSelect(event: any): void {
if (event.args) {
let item = event.args.item;
if (item) {
let valueElement = document.createElement('div');
valueElement.innerHTML = `Value: ${item.value}`;
let labelElement = document.createElement('div');
labelElement.innerHTML = `Label: ${item.label}`;
let selectionLog = this.log.nativeElement;
selectionLog.innerHTML = '';
selectionLog.appendChild(labelElement);
selectionLog.appendChild(valueElement);
}
}
};
}