UNPKG

jqwidgets-framework

Version:

jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.

59 lines (47 loc) 1.69 kB
import { Component, ViewChild } from '@angular/core'; import { jqxGridComponent } from 'jqwidgets-ng/jqxgrid' import { generatedata } from './../../../sampledata/generatedata'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { @ViewChild('myGrid', { static: false }) myGrid: jqxGridComponent; source: any = { localdata: generatedata(20, false), datafields: [ { name: 'name', type: 'string' }, { name: 'productname', type: 'string' }, { name: 'available', type: 'bool' }, { name: 'date', type: 'date' }, { name: 'quantity', type: 'number' } ], datatype: 'array' }; getWidth() : any { if (document.body.offsetWidth < 850) { return '90%'; } return 850; } dataAdapter: any = new jqx.dataAdapter(this.source); columns: any[] = [ { text: 'Name', columntype: 'textbox', filtertype: 'input', datafield: 'name', width: 215 }, { text: 'Product', filtertype: 'checkedlist', datafield: 'productname', width: 220 }, { text: 'Ship Date', datafield: 'date', filtertype: 'range', width: 210, cellsalign: 'right', cellsformat: 'd' }, { text: 'Qty.', datafield: 'quantity', filtertype: 'number', cellsalign: 'right' } ]; btnTopOnChecked(): void { if (this.myGrid) { this.myGrid.everpresentrowactions('add reset'); } } btnBottomOnChecked(): void { if (this.myGrid) { this.myGrid.everpresentrowactions('addBottom reset'); } } }