import { jqxGridComponent } from ‘jqwidgets-framework/jqwidgets-ts/angular_jqxgrid’;
@ViewChild(‘gridReference’) myGrid: jqxGridComponent;
ngAfterViewInit(): void {
this.myGrid.createWidget(this.settings);
}
source =
{
localdata: this.data(),
datatype: “local”,
datafields:
[
{ name: ‘firstname’, type: ‘string’ },
{ name: ‘lastname’, type: ‘string’ },
{ name: ‘productname’, type: ‘string’ }
]
};
dataAdapter = new jqx.dataAdapter(this.source);
settings: jqwidgets.GridOptions = {
source: this.dataAdapter,
columns:
[
{ text: ‘First Name’, datafield: ‘firstname’, width: 200 },
{ text: ‘Last Name’, datafield: ‘lastname’, width: 200 },
{ text: ‘Product’, datafield: ‘productname’, width: 200 }
]
};
I was trying to create jqwidgets grid in angular2. using the npm module jqwidgets-framework. It throwing error in createWidget function. Help me to resolve the error thanks.