I was following the example code but not sure how it is working since I get error that $.jqx.dataAdapter is undefined when creating a property of the class but seems to work in ngAfterViewInit()? I’m not sure if it is because of the demo.js file has some code in it so this work or not.
This does NOT work
source: any =
{
datatype: "xml",
datafields: [
{ name: 'ProductName', type: 'string' },
{ name: 'QuantityPerUnit', type: 'int' },
{ name: 'UnitPrice', type: 'float' },
{ name: 'UnitsInStock', type: 'float' },
{ name: 'Discontinued', type: 'bool' }
],
root: "Products",
record: "Product",
id: 'ProductID',
url: "../sampledata/products.xml"
};
dataAdapter: any = new $.jqx.dataAdapter(this.source); <----This is undefined
This does work:
dataAdapter: any:
ngAfterViewInit(){
this.dataAdapter = new $.jqx.dataAdapter(this.gridSource);
}