/// import { EventEmitter, AfterViewInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { FourDModel } from '../js44D/JSFourDModel'; import { FourDCollection } from '../js44D/JSFourDCollection'; import { FourDInterface, FourDQuery } from '../js44D/JSFourDInterface'; import * as i0 from "@angular/core"; export declare class DataGrid implements AfterViewInit { private http; private fourD; /** * Grid columns definition, follows kendo-ui format */ columns: any[]; /** * defines if grid rows are selectable */ selectable: boolean; /** * defines how grid selection should work (defaults to single, row) */ selectionMode: string; /** * flag to indicate if grid is editable, individual columns can have their own setting (defaults to false) */ editable: string; /** * flag to indicate if grid is filterable, individual columns can have their own setting (defaults to true) */ filterable: boolean; /** * flag to indicate if grid is sortable, individual columns can have their own setting (defaults to true) */ sortable: { mode: string; allowUnsort: boolean; showIndexes: boolean; }; /** * flag to indicate if the column reordering is enabled (defaults to true) */ reorderable: boolean; /** * flag to indicate if the column menu should be active for all columns on the grid (defaults to true) */ columnMenu: boolean; /** * Grid height */ height: string; /** * Filename to use when exporting to Excel */ excelFilename: string; /** * Various pageable options */ /** * enable the paging bar (default true) */ pageable: boolean; /** * enable refresh button on the paging bar (default true) */ pageableRefresh: boolean; /** * to display page sizes drop down on the paging toolbar (default true) */ pageableSizes: boolean; /** * defines max number of buttons to display on the paging toolbar (default 5) */ pageableButtonCount: number; /** * defines message pattern to display on the paging toolbar */ pageableMessage: string; pageableMessageCustom: { display: string; }; /** * the associated data model for the records to be retrieved */ set model(v: FourDModel); get model(): FourDModel; /** * option to use lazyloading, leaving paging to be done on server side (defaults to true) */ useLazyLoading: boolean; /** * if using a FourDModel, this flag will optimize the loading of data, by bringing only the columns used on the grid * thus avoiding bringing data that is not used on the grid * only meaningful if using a dataClass */ optimizeGridLoading: boolean; /** * if using lazyloading, define the max # of records to retrieve from 4D */ pageSize: number; /** * controls if header tooltip is enabled for all column headers * if a column definition includes a 'headerTemplate' or a 'headerAttributes' attribute, then generic header tooltip is disabled * that is to avoid conflict between this generic header tooltip and a possible user defined tooltip */ enableHeaderTooltip: boolean; /** * Callback function to determine the css class to aply to a row * this functions gets called for each row data, after datagrid row data is set * it must return a string that represents a css class * the function must take 2 arguments: * @rowData: is the row data toc test and validate * @element: is the HTML element, which can be use to set/change attributes * */ setRowClass: (rowData: any, element: any) => string; /** * indicate that the grid should be resized when the browser window resizes (default is true) */ autoResize: boolean; initialized: EventEmitter; rowSelected: EventEmitter; recordSelected: EventEmitter; loadDataComplete: EventEmitter; private _model; dataProvider: FourDCollection; gridObject: kendo.ui.Grid; private fourDTransport; private parseKendoFilters; private dataSource; /** * if using an external datasource, this field will hold it and be not null */ private externalDataSource; constructor(http: HttpClient, fourD: FourDInterface); theGrid: any; set queryString(v: FourDQuery); set orderBy(v: string); set filterQuery(v: string); /** * currently selected record on the grid */ get currentRecord(): FourDModel; set currentRecord(v: FourDModel); /** * record count on the current selection */ get recordCount(): number; /** * after our view gets initialized, instantiate the grid and its dataProvider */ ngAfterViewInit(): void; /** * Populates the grid with the result of a 4D query * @param query: the query string to send to 4D * @param filter: filter options to send to 4D, to be applied to the query result * @param orderby: order by statement to send to 4D, defining the record sort order */ loadData(query?: FourDQuery, filter?: string, orderby?: string): void; setModel(newModel: FourDModel): void; setDataSource(data: Array): void; setOptions(options: kendo.ui.GridOptions): void; rowClicked(event: any): void; dblClickRow(event: any): void; refresh(): void; resize(): void; /** * return currently selected grid row */ selectedRow(): any; /** * Update currently selected row with data from a * @param newData updated data record to be used to update current selected row */ updateSelectedRowData(newData?: FourDModel): void; /** * select a specific row on the grid * @param index row index to select * @param scrollTo flag to indicate if the grid should auto scroll to the selected row */ selectThisRow(index: any, scrollTo?: boolean): void; /** * clear current grid selection */ clearCurrentSelection(): void; /** * return currently selected grid row index */ selectedRowIndex(): number; /** * return currently selected rows indices, if multiple selection allowed */ selectedRows(): Array; /** * return currently selected records, if multiple selection allowed */ selectedRecords(): Array; /** * Export grid data to Excel */ exportGridToExcel(): void; /** * Find grid item in the data provider */ findRecordForThisItem(item: any): FourDModel; /** * Remove row from grid */ removeRow(row: number): void; setColumnConfig(columns: any): void; setExternalDataSource(dataSource: any, columns: any): void; getDataProvider(): FourDCollection; private initializeGrid; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }