当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ColumnController.getValueColumns方法代码示例

本文整理汇总了TypeScript中ag-grid/main.ColumnController.getValueColumns方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ColumnController.getValueColumns方法的具体用法?TypeScript ColumnController.getValueColumns怎么用?TypeScript ColumnController.getValueColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ag-grid/main.ColumnController的用法示例。


在下文中一共展示了ColumnController.getValueColumns方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

        Utils.iterateObject(uniqueValues, (key: string, value: any)=> {

            var newPivotKeys = pivotKeys.slice(0);
            newPivotKeys.push(key);

            var createGroup = index !== levelsDeep;
            if (createGroup) {
                var groupDef: ColGroupDef = {
                    children: [],
                    headerName: key
                };
                parentChildren.push(groupDef);
                this.recursivelyAddGroup(groupDef.children, pivotColumnDefs, index+1, value, newPivotKeys, columnIdSequence, levelsDeep);
            } else {

                var measureColumns = this.columnController.getValueColumns();
                var valueGroup: ColGroupDef = {
                    children: [],
                    headerName: key
                };
                parentChildren.push(valueGroup);
                // if no value columns selected, then we insert one blank column, so the user at least sees columns
                // rendered. otherwise the grid would render with no columns (just empty groups) which would give the
                // impression that the grid is broken
                if (measureColumns.length===0) {
                    // this is the blank column, for when no value columns enabled.
                    var colDef = this.createColDef(null, '-', newPivotKeys, columnIdSequence, `'n/a'`);
                    valueGroup.children.push(colDef);
                    pivotColumnDefs.push(colDef);
                } else {
                    measureColumns.forEach( measureColumn => {
                        var colDef = this.createColDef(measureColumn, measureColumn.getColDef().headerName, newPivotKeys, columnIdSequence, null);
                        valueGroup.children.push(colDef);
                        pivotColumnDefs.push(colDef);
                    });
                }
                valueGroup.children.sort(this.headerNameComparator.bind(this));

            }
            parentChildren.sort(this.headerNameComparator.bind(this));
        });
开发者ID:pmehra7,项目名称:ag-grid-enterprise,代码行数:41,代码来源:pivotColDefService.ts

示例2: getExistingColumns

 protected getExistingColumns(): Column[] {
     return this.columnController.getValueColumns();
 }
开发者ID:pmehra7,项目名称:ag-grid-enterprise,代码行数:3,代码来源:valueColumnsPanel.ts


注:本文中的ag-grid/main.ColumnController.getValueColumns方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。