• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript ag-grid-community.Utils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中ag-grid-community.Utils的典型用法代码示例。如果您正苦于以下问题:TypeScript Utils类的具体用法?TypeScript Utils怎么用?TypeScript Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: workbook

    private workbook(docProperties: XmlElement, eWorkbook: XmlElement, styles: ExcelStyle[], worksheets: ExcelWorksheet[]) : XmlElement {
        const children : XmlElement [] = [
            docProperties,
            eWorkbook,
            this.stylesXmlElement(styles)
        ].concat(Utils.map(worksheets, (it):XmlElement => worksheet.getTemplate(it)));

        return Utils.assign({}, workbook.getTemplate(), {children});
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:9,代码来源:excelXmlFactory.ts


示例2: styleXmlElement

    private styleXmlElement(styleProperties:ExcelStyle):XmlElement {
        const children = Utils.compose(
            this.addProperty('alignment', styleProperties),
            this.addProperty('borders', styleProperties),
            this.addProperty('font', styleProperties),
            this.addProperty('interior', styleProperties),
            this.addProperty('protection', styleProperties),
            this.addProperty('numberFormat', styleProperties)
        )([]);

        return Utils.assign({}, style.getTemplate(styleProperties), {children});
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:12,代码来源:excelXmlFactory.ts


示例3: setState

 public setState(value: any, valueFormatted: string, selected: boolean): void {
     let rendererSuccessful = this.populateWithRenderer(value, valueFormatted);
     if (!rendererSuccessful) {
         this.populateWithoutRenderer(value, valueFormatted);
     }
     Utils.addOrRemoveCssClass(this.getGui(), 'ag-rich-select-row-selected', selected);
 }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:7,代码来源:richSelectRow.ts


示例4: stylesXmlElement

 private stylesXmlElement(styles:ExcelStyle[]):XmlElement {
     return {
         name:'Styles',
         children:styles ? Utils.map(styles, (it) => {
             return this.styleXmlElement (it);
         }): []
     };
 }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:8,代码来源:excelXmlFactory.ts


示例5: populateWithoutRenderer

    private populateWithoutRenderer(value: any, valueFormatted: string) {
        let valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined;
        let valueToRender = valueFormattedExits ? valueFormatted : value;

        if (Utils.exists(valueToRender) && valueToRender !== '') {
            // not using innerHTML to prevent injection of HTML
            // https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#Security_considerations
            this.getGui().textContent = valueToRender.toString();
        } else {
            // putting in blank, so if missing, at least the user can click on it
            this.getGui().innerHTML = ' ';
        }
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:13,代码来源:richSelectRow.ts


示例6: getMenuItems

    private getMenuItems(node: RowNode, column: Column, value: any): (MenuItemDef|string)[] {
        let defaultMenuOptions: string[];
        if (Utils.exists(node)) {

            defaultMenuOptions = [];

            if (column) {
                // only makes sense if column exists, could have originated from a row
                defaultMenuOptions = ['copy','copyWithHeaders','paste', 'separator'];
            }

            // if user clicks a cell
            let suppressExcel = this.gridOptionsWrapper.isSuppressExcelExport();
            let suppressCsv = this.gridOptionsWrapper.isSuppressCsvExport();
            let onIPad = _.isUserAgentIPad();
            let anyExport: boolean = !onIPad && (!suppressExcel || !suppressCsv);
            if (anyExport) {
                defaultMenuOptions.push('export');
            }
        } else {
            // if user clicks outside of a cell (eg below the rows, or not rows present)
            // nothing to show, perhaps tool panels???
        }
        if (this.gridOptionsWrapper.getContextMenuItemsFunc()) {
            let userFunc: GetContextMenuItems = this.gridOptionsWrapper.getContextMenuItemsFunc();
            let params: GetContextMenuItemsParams = {
                node: node,
                column: column,
                value: value,
                defaultItems: defaultMenuOptions,
                api: this.gridOptionsWrapper.getApi(),
                columnApi: this.gridOptionsWrapper.getColumnApi(),
                context: this.gridOptionsWrapper.getContext()
            };
            let menuItemsFromUser = userFunc(params);
            return menuItemsFromUser;
        } else {
            return defaultMenuOptions;
        }
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:40,代码来源:contextMenu.ts


示例7: showMenu

    public showMenu(node: RowNode, column: Column, value: any, mouseEvent: MouseEvent | Touch): void {

        let menuItems = this.getMenuItems(node, column, value);

        if (Utils.missingOrEmpty(menuItems)) { return; }

        let menu = new ContextMenu(menuItems);
        this.context.wireBean(menu);

        let eMenuGui =  menu.getGui();

        // need to show filter before positioning, as only after filter
        // is visible can we find out what the width of it is
        let hidePopup = this.popupService.addAsModalPopup(
            eMenuGui,
            true,
            ()=> menu.destroy(),
            mouseEvent
        );

        this.popupService.positionPopupUnderMouseEvent({
            column: column,
            rowNode: node,
            type: 'contextMenu',
            mouseEvent: mouseEvent,
            ePopup: eMenuGui
        });

        menu.afterGuiAttached({
            hidePopup: hidePopup
        });

        this.activeMenu = menu;
        menu.addEventListener(BeanStub.EVENT_DESTROYED, ()=> {
            if (this.activeMenu===menu) {
                this.activeMenu = null;
            }
        });
    }
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:39,代码来源:contextMenu.ts


示例8: getTemplate

import {XmlElement, Utils} from 'ag-grid-community';
import {ExcelXMLTemplate, ExcelWorksheet} from 'ag-grid-community';
import column from './column';
import row from './row';

const worksheet: ExcelXMLTemplate = {
    getTemplate(ws: ExcelWorksheet): XmlElement {
        const {table, name} = ws;
        const {columns, rows} = table;

        const c = Utils.map(columns, (it):XmlElement => column.getTemplate(it));
        const r = Utils.map(rows, (it):XmlElement => row.getTemplate(it));

        return {
            name: "Worksheet",
            children:[{
                name:"Table",
                children: c.concat(r)
            }],
            properties:{
                prefixedAttributes: [{
                    prefix:"ss:",
                    map: {
                        Name: name
                    }
                }]
            }
        };
    }
};
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:30,代码来源:worksheet.ts


示例9: getTemplate

import {XmlElement, Utils} from 'ag-grid-community';
import {ExcelCell, ExcelRow, ExcelXMLTemplate} from 'ag-grid-community';
import cell from './cell';

const row: ExcelXMLTemplate = {
    getTemplate(r: ExcelRow): XmlElement {
        const {cells} = r;

        return {
            name: "Row",
            children: Utils.map(cells, (it:ExcelCell):XmlElement => {
                return cell.getTemplate(it);
            })
        };
    }
};

export default row;
开发者ID:Hyeong-jin,项目名称:ag-grid,代码行数:18,代码来源:row.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript ag-grid-community.XmlElement类代码示例发布时间:2022-05-28
下一篇:
TypeScript ag-grid-community.GridApi类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap