UNPKG

igniteui-angular-wrappers

Version:
444 lines (443 loc) 25 kB
import { ElementRef, KeyValueDiffers, IterableDiffers, ChangeDetectorRef, Renderer2 } from '@angular/core'; import { IgGridBase } from './iggridbase'; import * as i0 from "@angular/core"; export declare class IgGridComponent extends IgGridBase<IgGrid> { constructor(el: ElementRef, renderer: Renderer2, differs: IterableDiffers, kvalDiff: KeyValueDiffers, cdr: ChangeDetectorRef); /** * Returns the element holding the data records */ widget(): void; /** * Returns whether grid has non-data fixed columns(e.g. row selectors column) */ hasFixedDataSkippedColumns(): boolean; /** * Returns true if grid has at least one fixed columns(even if a non-data column - like row-selectors column) */ hasFixedColumns(): boolean; /** * Returns the current fixing direction. NOTE - use only if ColumnFixing feature is enabled * @return left|right */ fixingDirection(): string; /** * Returns whether the column with identifier colKey is fixed * * @param colKey An identifier of the column which should be checked. It can be a key or visible index. */ isFixedColumn(colKey: object): boolean; /** * Called to detect whether grid container is resized. * When autoAdjustHeight is true and height of the grid is changed then the height of grid is re-set. */ resizeContainer(): void; /** * Returns whether the header identified by colKey is multicolumn header(has children) * * @param colKey value of the column key */ isGroupHeader(colKey: string): object; /** * Returns an object that contains information on the passed Dom element * * rowId - the id of the record associated with the element - if primaryKey is not set this will be null. * rowIndex - the index (in the DOM) of the row associated with the element. * recordIndex - index of the data record associated with this element in the current dataView. * columnObject - the column object associated with this element ( if the element is tr this will be null) * * @param elem The Dom element or jQuery object which can be a TD or TR element from the grid. */ getElementInfo(elem: Element): object; /** * Returns the ID of the TABLE element where data records are rendered */ id(): string; /** * Returns the DIV that is the topmost container of the grid widget */ container(): Element; /** * Returns the table that contains the header cells */ headersTable(): Element; /** * Returns the table that contains the footer cells */ footersTable(): Element; /** * Returns the DIV that is used as a scroll container for the grid contents */ scrollContainer(): Element; /** * Returns the DIV that is the topmost container of the fixed grid - contains fixed columns(in ColumnFixing scenario) */ fixedContainer(): Element; /** * Returns the DIV that is the topmost container of the fixed body grid - contains fixed columns(in ColumnFixing scenario) */ fixedBodyContainer(): Element; /** * Returns container(jQuery representation) containing fixed footer - contains fixed columns(in ColumnFixing scenario) */ fixedFooterContainer(): object; /** * Returns container(jQuery representation) containing fixed header - contains fixed columns(in ColumnFixing scenario) */ fixedHeaderContainer(): object; /** * Returns the table that contains the FIXED header cells - contains fixed columns(in ColumnFixing scenario) */ fixedHeadersTable(): Element; /** * Returns the table that contains the footer cells - contains fixed columns(in ColumnFixing scenario) */ fixedFootersTable(): Element; /** * Returns the cell TD element at the specified location * * @param x The column index. * @param y The row index. * @param isFixed Optional parameter - if true get cell TD at the specified location from the fixed table */ cellAt(x: number, y: number, isFixed: boolean): Element; /** * Returns the cell TD element by row id and column key * * @param rowId The id of the row. * @param columnKey The column key. */ cellById(rowId: object, columnKey: string): Element; /** * Returns the fixed table - contains fixed columns(in ColumnFixing scenario). If there aren't fixed columns returns the grid table */ fixedTable(): object; /** * Gets all immediate children of the current grid */ immediateChildrenWidgets(): any[]; /** * Gets all children of the current grid, recursively */ childrenWidgets(): any[]; /** * Gets all children's elements of the current grid, recursively */ children(): any[]; /** * Gets all immediate children's elements of the current grid */ immediateChildren(): any[]; /** * Returns the row (TR element) at the specified index. jQuery selectors aren't used for performance reasons * * @param i The row index. */ rowAt(i: number): Element; /** * Returns the row TR element by row id * * @param rowId The id of the row. * @param isFixed Specify search in the fixed container. */ rowById(rowId: object, isFixed?: boolean): Element; /** * Returns the fixed row (TR element) at the specified index. * jQuery selectors aren't used for performance reasons(in ColumnFixing scenario - only when there is at least one fixed column) * * @param i The row index. */ fixedRowAt(i: number): Element; /** * Returns a list of all fixed TR elements holding data in the grid, * in ColumnFixing scenario - only when there is at least one fixed column */ fixedRows(): any[]; /** * Returns a list of all TR elements holding data in the grid, * when there is at least one fixed column returns rows only in the UNFIXED table */ rows(): any[]; /** * Returns all data fixed rows recursively, not only the immediate ones, * in ColumnFixing scenario - only when there is at least one fixed column */ allFixedRows(): any[]; /** * Returns all data rows recursively, not only the immediate ones, * when there is at least one fixed column returns rows only in the UNFIXED table */ allRows(): any[]; /** * Returns a column object by the specified column key * * @param key The column key. */ columnByKey(key: string): object; /** * Returns a column object by the specified header text. If there are multiple matches, returns the first one. * * @param text The column header text. */ columnByText(text: string): object; /** * Returns an array of selected cells in arbitrary order where every objects has the format * { element: , row: , index: , rowIndex: , columnKey: } . * If multiple selection is disabled the function will return null. */ selectedCells(): any[]; /** * Returns an array of selected rows in arbitrary order where every object has the format { element: , index: }. * If multiple selection is disabled the function will return null. */ selectedRows(): any[]; /** * Returns the currently selected cell that has the format { element: , row: , index: , rowIndex: , columnKey: }, if any. * If multiple selection is enabled the function will return null. */ selectedCell(): object; /** * Returns the currently selected row that has the format { element: , index: }, if any. * If multiple selection is enabled the function will return null. */ selectedRow(): object; /** * Returns the currently active (focused) cell that has the format { element: , row: , index: , rowIndex: , columnKey: }, if any. */ activeCell(): object; /** * Returns the currently active (focused) row that has the format { element: , index: }, if any. */ activeRow(): object; /** * Retrieves a cell value using the row index and the column key. * If a primaryKey is defined, rowId is assumed to be the row Key (not index). * If primary key is not defined, then rowId is converted to a number and is used as a row index. * * @param rowId Row index or row key (primary key). * @param colKey The column key. */ getCellValue(rowId: any, colKey: string): any; /** * Returns the cell text. If colKey is a number, the index of the column is used (instead of a column name) * - does not apply when using a Multi-Row Layout grid. * This is the actual text (or HTML string) for the contents of the cell. * * @param rowId Row index or row data key (primary key) * @param colKey Column key. */ getCellText(rowId: object, colKey: string): string; /** * Sets a new template for a column after initialization and renders the grid if not explicitly disabled. * This method will replace any existing explicitly set row template and will build one anew from the column ones. * * @param col An identifier of the column to set template for (index or key) * @param tmpl The column template to set * @param render Should the grid rerender after template is set */ setColumnTemplate(col: object, tmpl: string, render?: boolean): void; /** * Commits all pending transactions to the client data source. * Note that there won't be anything to commit on the UI, since it is updated instantly. * In order to rollback the actual UI, a call to dataBind() is required. * * @param rowId If specified, will commit only that transaction corresponding to the specified record key. */ commit(rowId?: object): void; /** * Clears the transaction log (delegates to igDataSource). Note that this does not update the UI. * In case the UI must be updated, set the second parameter "updateUI" to true, * which will trigger a call to dataBind() to re-render the contents. * * @param rowId If specified, will only rollback the transactions with that row id. * @param updateUI Whether to update the UI or not. */ rollback(rowId?: object, updateUI?: boolean): any[]; /** * Returns a record by a specified key (requires that primaryKey is set in the settings). * That is a wrapper for this.dataSource.findRecordByKey(key). * * @param key Primary key of the record */ findRecordByKey(key: object): object; /** * Returns a standalone object (copy) that represents the committed transactions, but detached from the data source. * That is a wrapper for this.dataSource.getDetachedRecord(t). * * @param t A transaction object. */ getDetachedRecord(t: object): object; /** * Returns a list of all transaction objects that are pending to be committed or rolled back to the data source. * That is a wrapper for this.dataSource.pendingTransactions(). */ pendingTransactions(): any[]; /** * Returns a list of all transaction objects that are either pending, or have been committed in the data source. * That is a wrapper for this.dataSource.allTransactions(). */ allTransactions(): any[]; /** * Returns the accumulated transaction log as a string. The purpose of this is to be passed to URLs or used conveniently. * That is a wrapper for this.dataSource.transactionsAsString(). */ transactionsAsString(): string; /** * Invokes an AJAX request to the updateUrl option (if specified) and passes the serialized transaction log * (a serialized JSON string) as part of the POST request. * * @param success Specifies a custom function to be called when AJAX request to the updateUrl option succeeds(optional) * @param error Specifies a custom function to be called when AJAX request to the updateUrl option fails(optional) */ saveChanges(success: () => void, error: () => void): void; /** * Adds a new row (TR) to the grid, by taking a data row object. Assumes the record will have the primary key. * * @param rec Identifier/key of row. If missing, then number of rows in grid is used. */ renderNewRow(rec?: string): void; /** * If the data source points to a local JSON array of data, and it is necessary to reset it at runtime, * it must be done through this API member instead of the options (options.dataSource) * * @param dataSource New data source object. */ dataSourceObject(dataSource: object): void; /** * Returns the total number of records in the underlying backend. * If paging or filtering is enabled, this may differ from the number of records in the client-side data source. * In order for this to work, the response JSON/XML must include a property that specifies the total number of records, * which name is specified by options.responseTotalRecCountKey. * This functionality is completely delegated to the data source control. */ totalRecordsCount(): number; /** * Causes the grid to data bind to the data source (local or remote) , and re-render all of the data as well * * @param internal internal call flag */ dataBind(internal: object): void; /** * Moves a visible column at a specified place, in front or behind a target column or at a target index * Note: This method is asynchronous which means that it returns immediately and any subsequent code will execute in parallel. * This may lead to runtime errors. To avoid them put the subsequent code in the callback parameter provided by the method. * * @param column An identifier of the column to be moved. * It can be a key, a Multi-Column Header identificator, or an index in a number format. * The latter is not supported when the grid contains multi-column headers. * @param target An identifier of a column where the moved column should move to or an index at which the moved * column should be moved to. In the case of a column identifier the column will be moved after it by default. * @param after Specifies whether the column moved should be moved after or before the target column. * This parameter is disregarded if there is no target column specified but a target index is used. * @param inDom Specifies whether the column moving will be enacted through DOM manipulation or through rerendering of the grid. * @param callback Specifies a custom function to be called when the column is moved. */ moveColumn(column: object, target: object, after?: boolean, inDom?: boolean, callback?: () => void): void; /** * Shows a hidden column. If the column is not hidden the method does nothing. * Note: This method is asynchronous which means that it returns immediately and any subsequent code will execute in parallel. * This may lead to runtime errors. To avoid them put the subsequent code in the callback parameter provided by the method. * * @param column An identifier for the column. If a number is provided it will be used as a column index. * If a string is provided it will be used as a column key. * @param callback Specifies a custom function to be called when the column is shown(optional) */ showColumn(column: object, callback: () => void): void; /** * Hides a visible column. If the column is hidden the method does nothing. * Note: This method is asynchronous which means that it returns immediately and any subsequent code will execute in parallel. * This may lead to runtime errors. To avoid them put the subsequent code in the callback parameter provided by the method. * * @param column An identifier for the column. * If a number is provided it will be used as a column index else if a string is provided it will be used as a column key. * @param callback Specifies a custom function to be called when the column is hidden(optional) */ hideColumn(column: object, callback: () => void): void; /** * Gets unbound values for the specified column key. If key is not specified returns all unboundvalues * * @param key column key */ getUnboundValues(key: string): object; /** * Sets unbound values for the unbound column with the specified key. * If removeOldValues is true then values(if any) for the unbound columns are re-set with the new values * * @param key key of the unbound column * @param values array of values to be set on unbound values * @param removeOldValues if true removes current unbound values(if any) for the specified column and apply the new ones specified * in parameter values. Otherwise merge current values with the specified in parameter values */ setUnboundValues(key: string, values: any[], removeOldValues: object): void; /** * Sets unbound value for the unbound cell by the specified column key and row primary key. * * @param col key of the unbound column * @param rowId primary key value of the row * @param val value to be set on unbound cell * @param notToRender if false will re-render the row */ setUnboundValueByPK(col: string, rowId: string, val: object, notToRender: object): void; /** * Returns an unbound column with the specified key. If not found returns null * * @param key a column key */ getUnboundColumnByKey(key: string): object; /** * Returns whether there is vertical scrollbar. Because of perfrormance issues in older Internet Explorer especially 8,9 - * there is no need to check if height is not set - there is no scrollbar OR if row virtualization is enabled - * it is supposed there is vertical scrollbar */ hasVerticalScrollbar(): object; /** * Auto resize columns that have property width set to "*" so content to be auto-fitted(not shrinked/cutted). * Auto-resizing is applied ONLY for visible columns */ autoSizeColumns(): void; /** * Calculates the width of the column so its content to be auto-fitted to the width of the data in it * (the content should NOT be shrinked/cutted) * * @param columnIndex Visible column index */ calculateAutoFitColumnWidth(columnIndex: number): number; /** * Get visible index by specified column key. If column is not found or is hidden then returns -1. * Note: Method does not count column groups (Multi-Column Headers). * * @param columnKey columnKey * @param includeDataSkip Optional parameter - if set to true include non data columns * (like expander column, row selectors column, etc.) in calculations */ getVisibleIndexByKey(columnKey: string, includeDataSkip: boolean): number; /** * When called the method re-renders the whole grid(also rebinds to the data source) and renders the cols object * * @param cols an array of column objects */ renderMultiColumnHeader(cols: any[]): void; /** * Scroll to the specified row or specified position(in pixels) * * @param scrollerPosition An identifier of the vertical scroll position. * When it is string then it is interpreted as pixels otherwise it is the row number */ virtualScrollTo(scrollerPosition: object): void; /** * Returns column object and visible index for the table cell(TD) which is passed as argument * * @param $td cell(TD) - either DOM TD element or jQuery object */ getColumnByTD($td: object): object; /** * Destroy is part of the jQuery UI widget API and does the following: * 1. Remove custom CSS classes that were added. * 2. Unwrap any wrapping elements such as scrolling divs and other containers. * 3. Unbind all events that were bound. * * @param notToCallDestroy flag whether to propagate the destroy call */ destroy(notToCallDestroy: object): void; static ɵfac: i0.ɵɵFactoryDeclaration<IgGridComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IgGridComponent, "ig-grid", never, { "widgetId": { "alias": "widgetId"; "required": false; }; "options": { "alias": "options"; "required": false; }; "changeDetectionInterval": { "alias": "changeDetectionInterval"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "create": { "alias": "create"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "autoAdjustHeight": { "alias": "autoAdjustHeight"; "required": false; }; "avgRowHeight": { "alias": "avgRowHeight"; "required": false; }; "avgColumnWidth": { "alias": "avgColumnWidth"; "required": false; }; "defaultColumnWidth": { "alias": "defaultColumnWidth"; "required": false; }; "autoGenerateColumns": { "alias": "autoGenerateColumns"; "required": false; }; "virtualization": { "alias": "virtualization"; "required": false; }; "virtualizationMode": { "alias": "virtualizationMode"; "required": false; }; "requiresDataBinding": { "alias": "requiresDataBinding"; "required": false; }; "rowVirtualization": { "alias": "rowVirtualization"; "required": false; }; "columnVirtualization": { "alias": "columnVirtualization"; "required": false; }; "virtualizationMouseWheelStep": { "alias": "virtualizationMouseWheelStep"; "required": false; }; "adjustVirtualHeights": { "alias": "adjustVirtualHeights"; "required": false; }; "templatingEngine": { "alias": "templatingEngine"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "dataSourceUrl": { "alias": "dataSourceUrl"; "required": false; }; "dataSourceType": { "alias": "dataSourceType"; "required": false; }; "responseDataKey": { "alias": "responseDataKey"; "required": false; }; "responseTotalRecCountKey": { "alias": "responseTotalRecCountKey"; "required": false; }; "requestType": { "alias": "requestType"; "required": false; }; "responseContentType": { "alias": "responseContentType"; "required": false; }; "showHeader": { "alias": "showHeader"; "required": false; }; "showFooter": { "alias": "showFooter"; "required": false; }; "fixedHeaders": { "alias": "fixedHeaders"; "required": false; }; "fixedFooters": { "alias": "fixedFooters"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "features": { "alias": "features"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "localSchemaTransform": { "alias": "localSchemaTransform"; "required": false; }; "primaryKey": { "alias": "primaryKey"; "required": false; }; "serializeTransactionLog": { "alias": "serializeTransactionLog"; "required": false; }; "autoCommit": { "alias": "autoCommit"; "required": false; }; "aggregateTransactions": { "alias": "aggregateTransactions"; "required": false; }; "autoFormat": { "alias": "autoFormat"; "required": false; }; "renderCheckboxes": { "alias": "renderCheckboxes"; "required": false; }; "updateUrl": { "alias": "updateUrl"; "required": false; }; "restSettings": { "alias": "restSettings"; "required": false; }; "alternateRowStyles": { "alias": "alternateRowStyles"; "required": false; }; "autofitLastColumn": { "alias": "autofitLastColumn"; "required": false; }; "enableHoverStyles": { "alias": "enableHoverStyles"; "required": false; }; "enableUTCDates": { "alias": "enableUTCDates"; "required": false; }; "mergeUnboundColumns": { "alias": "mergeUnboundColumns"; "required": false; }; "jsonpRequest": { "alias": "jsonpRequest"; "required": false; }; "enableResizeContainerCheck": { "alias": "enableResizeContainerCheck"; "required": false; }; "featureChooserIconDisplay": { "alias": "featureChooserIconDisplay"; "required": false; }; "scrollSettings": { "alias": "scrollSettings"; "required": false; }; }, { "cellClick": "cellClick"; "cellRightClick": "cellRightClick"; "dataBinding": "dataBinding"; "dataBound": "dataBound"; "rendering": "rendering"; "rendered": "rendered"; "dataRendering": "dataRendering"; "dataRendered": "dataRendered"; "headerRendering": "headerRendering"; "headerRendered": "headerRendered"; "footerRendering": "footerRendering"; "footerRendered": "footerRendered"; "headerCellRendered": "headerCellRendered"; "rowsRendering": "rowsRendering"; "rowsRendered": "rowsRendered"; "schemaGenerated": "schemaGenerated"; "columnsCollectionModified": "columnsCollectionModified"; "requestError": "requestError"; "created": "created"; "destroyed": "destroyed"; }, never, ["*"], false, never>; }