How to use the ag-grid-community.Constants function in ag-grid-community

To help you get started, we’ve selected a few ag-grid-community examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ag-grid / ag-grid-enterprise / dist / lib / menu / enterpriseMenu.js View on Github external
EnterpriseMenu.prototype.getDefaultMenuOptions = function () {
        var result = [];
        var allowPinning = !this.column.getColDef().lockPinned;
        var rowGroupCount = this.columnController.getRowGroupColumns().length;
        var doingGrouping = rowGroupCount > 0;
        var groupedByThisColumn = this.columnController.getRowGroupColumns().indexOf(this.column) >= 0;
        var allowValue = this.column.isAllowValue();
        var allowRowGroup = this.column.isAllowRowGroup();
        var isPrimary = this.column.isPrimary();
        var pivotModeOn = this.columnController.isPivotMode();
        var isInMemoryRowModel = this.rowModel.getType() === ag_grid_community_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE;
        var usingTreeData = this.gridOptionsWrapper.isTreeData();
        var allowValueAgg = 
        // if primary, then only allow aggValue if grouping and it's a value columns
        (isPrimary && doingGrouping && allowValue)
            // secondary columns can always have aggValue, as it means it's a pivot value column
            || !isPrimary;
        if (allowPinning) {
            result.push('pinSubMenu');
        }
        if (allowValueAgg) {
            result.push('valueAggSubMenu');
        }
        if (allowPinning || allowValueAgg) {
            result.push(EnterpriseMenu.MENU_ITEM_SEPARATOR);
        }
        result.push('autoSizeThis');
github ag-grid / ag-grid-enterprise / dist / lib / clipboardService.js View on Github external
ClipboardService.prototype.copyFocusedCellToClipboard = function (includeHeaders) {
        var _a;
        if (includeHeaders === void 0) { includeHeaders = false; }
        var focusedCell = this.focusedCellController.getFocusedCell();
        if (ag_grid_community_1._.missing(focusedCell)) {
            return;
        }
        var cellId = this.cellPositionUtils.createId(focusedCell);
        var currentRow = { rowPinned: focusedCell.rowPinned, rowIndex: focusedCell.rowIndex };
        var rowNode = this.rowPositionUtils.getRowNode(currentRow);
        var column = focusedCell.column;
        var value = this.valueService.getValue(column, rowNode);
        var processedValue = this.userProcessCell(rowNode, column, value, this.gridOptionsWrapper.getProcessCellForClipboardFunc(), ag_grid_community_1.Constants.EXPORT_TYPE_CLIPBOARD);
        if (ag_grid_community_1._.missing(processedValue)) {
            // copy the new line character to clipboard instead of an empty string, as the 'execCommand' will ignore it.
            // this behaviour is consistent with how Excel works!
            processedValue = '\t';
        }
        var data = '';
        if (includeHeaders) {
            var headerValue = this.columnController.getDisplayNameForColumn(column, 'clipboard', true);
            data = this.userProcessHeader(column, headerValue, this.gridOptionsWrapper.getProcessHeaderForClipboardFunc());
            data += '\r\n';
        }
        data += processedValue.toString();
        this.copyDataToClipboard(data);
        this.dispatchFlashCells((_a = {}, _a[cellId] = true, _a));
    };
    ClipboardService.prototype.dispatchFlashCells = function (cellsToFlash) {
github ag-grid / ag-grid-enterprise / dist / lib / rangeController.js View on Github external
AutoScrollService.prototype.check = function (mouseEvent, skipVerticalScroll) {
        if (skipVerticalScroll === void 0) { skipVerticalScroll = false; }
        var rect = this.gridPanel.getBodyClientRect();
        skipVerticalScroll = skipVerticalScroll || this.gridOptionsWrapper.getDomLayout() !== ag_grid_community_1.Constants.DOM_LAYOUT_NORMAL;
        // we don't do ticking if grid is auto height unless we have a horizontal scroller
        if (skipVerticalScroll && !this.gridPanel.isHorizontalScrollShowing()) {
            return;
        }
        this.tickLeft = mouseEvent.clientX < (rect.left + 20);
        this.tickRight = mouseEvent.clientX > (rect.right - 20);
        this.tickUp = mouseEvent.clientY < (rect.top + 20) && !skipVerticalScroll;
        this.tickDown = mouseEvent.clientY > (rect.bottom - 20) && !skipVerticalScroll;
        if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) {
            this.ensureTickingStarted();
        }
        else {
            this.ensureCleared();
        }
    };
    AutoScrollService.prototype.ensureTickingStarted = function () {
github ag-grid / ag-grid-enterprise / dist / lib / charts / chartEverythingDatasource.js View on Github external
ChartEverythingDatasource.prototype.postConstruct = function () {
        if (this.clientSideRowModel.getType() !== ag_grid_community_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
            console.error('ChartEverythingDatasource only works with ClientSideRowModel');
            return;
        }
        this.reset();
        this.addDestroyableEventListener(this.eventService, ag_grid_community_1.Events.EVENT_COLUMN_VISIBLE, this.onModelUpdated.bind(this));
        this.addDestroyableEventListener(this.eventService, ag_grid_community_1.Events.EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this));
        this.addDestroyableEventListener(this.eventService, ag_grid_community_1.Events.EVENT_CELL_VALUE_CHANGED, this.onModelUpdated.bind(this));
    };
    ChartEverythingDatasource.prototype.reset = function () {
github ag-grid / ag-grid-enterprise / dist / lib / rangeController.js View on Github external
RangeController.prototype.getRangeStartRow = function (cellRange) {
        if (cellRange.startRow && cellRange.endRow) {
            var startRowIsFirst = this.rowPositionUtils.before(cellRange.startRow, cellRange.endRow);
            return startRowIsFirst ? cellRange.startRow : cellRange.endRow;
        }
        var pinned = (this.pinnedRowModel.getPinnedTopRowCount() > 0) ? ag_grid_community_1.Constants.PINNED_TOP : undefined;
        return { rowIndex: 0, rowPinned: pinned };
    };
    RangeController.prototype.getRangeEndRow = function (cellRange) {
github ag-grid / ag-grid-enterprise / dist / lib / rendering / richSelect / richSelectCellEditor.js View on Github external
RichSelectCellEditor.prototype.onKeyDown = function (event) {
        var key = event.which || event.keyCode;
        switch (key) {
            case ag_grid_community_1.Constants.KEY_ENTER:
                this.onEnterKeyDown();
                break;
            case ag_grid_community_1.Constants.KEY_DOWN:
            case ag_grid_community_1.Constants.KEY_UP:
                this.onNavigationKeyPressed(event, key);
                break;
            default:
                this.searchText(event);
        }
    };
    RichSelectCellEditor.prototype.onEnterKeyDown = function () {
github ag-grid / ag-grid-enterprise / dist / lib / setFilter / setFilter.js View on Github external
SetFilter.prototype.onMiniFilterKeyPress = function (e) {
        if (ag_grid_community_1._.isKeyPressed(e, ag_grid_community_1.Constants.KEY_ENTER)) {
            this.onEnterKeyOnMiniFilter();
        }
    };
    SetFilter.prototype.onEnterKeyOnMiniFilter = function () {
github ag-grid / ag-grid-enterprise / dist / lib / exporter / excelXmlSerializingSession.js View on Github external
return function (column, index, node) {
            var valueForCell = _this.extractRowCellValue(column, index, ag_grid_community_1.Constants.EXPORT_TYPE_EXCEL, node);
            var styleIds = that.styleLinker(ag_grid_community_1.RowType.BODY, rowIndex, index, valueForCell, column, node);
            var excelStyleId;
            if (styleIds && styleIds.length == 1) {
                excelStyleId = styleIds[0];
            }
            else if (styleIds && styleIds.length > 1) {
                var key = styleIds.join("-");
                if (!_this.mixedStyles[key]) {
                    _this.addNewMixedStyle(styleIds);
                }
                excelStyleId = _this.mixedStyles[key].excelID;
            }
            var type = ag_grid_community_1._.isNumeric(valueForCell) ? 'Number' : 'String';
            currentCells.push(that.createCell(excelStyleId, type, valueForCell));
        };
    };
github ag-grid / ag-grid-enterprise / dist / lib / rowModels / serverSide / serverSideRowModel.js View on Github external
ServerSideRowModel.prototype.getType = function () {
        return ag_grid_community_1.Constants.ROW_MODEL_TYPE_SERVER_SIDE;
    };
    ServerSideRowModel.prototype.forEachNode = function (callback) {
github ag-grid / ag-grid-enterprise / dist / lib / rowModels / viewport / viewportRowModel.js View on Github external
ViewportRowModel.prototype.getType = function () {
        return ag_grid_community_1.Constants.ROW_MODEL_TYPE_VIEWPORT;
    };
    ViewportRowModel.prototype.getRow = function (rowIndex) {