如何更改ng网格中的工具提示

时间:2017-09-26 14:47:44

标签: javascript angularjs devexpress ng-grid devextreme

我想在“导出到Excel”按钮中更改工具提示名称。我有角度指令(ng-grid)。指令配置为:

var defaultConfig = {
                                    dataSource: {
                                            dataPath: "gridCtrl.getFilteredData(true)",
                                            deep: false,
                                        },
                                    bindingOptions: {
                                            dataSource: {
                                                    dataPath: "gridCtrl.getFilteredData(true)",
                                                    deep: false,
                                                },
                                            columns: "gridCtrl.getColumns()"
                                        },
                                    remoteOperations:  false,
                                    focusStateEnabled: true,
                                    hoverStateEnabled: true,
                                    allowColumnReordering: true,
                                    editing: { editEnabled: false },
                                    paging: { enabled: true, pageSize: 25 },
                                    pager: { showPageSizeSelector: true, allowedPageSizes: [10, 25, 50, 100] },
                                    filterRow: { visible: true, applyFilter: "auto" },
                                    sorting: { mode: "multiple" },
                                    searchPanel: { width: 240, placeholder: $i18n.translate("lbl_search") },
                                    headerFilter: { visible: true },
                                    groupPanel: { visible: true, allowColumnDragging: true, emptyPanelText: $i18n.translate("txt_arrastrar_columna") },
                                    allowColumnResizing: true,
                                    columnAutoWidth: false,
                                    columnChooser: { enabled: false, emptyPanelText: $i18n.translate("lbl_hide_columns_here"), title: $i18n.translate("lbl_column_chooser") },                                        
                                    rowAlternationEnabled: true,
                                    showExpandAll: false,
                                    summary: {
                                            totalItems: [{
                                                column:0,
                                                summaryType:"count",
                                                customizeText: function (resourceInfo){ return $i18n.translate("lbl_total_items")+": "+resourceInfo.value; }
                                            }]
                                        },
                                }; 

enter image description here

我想要更改的工具提示是“导出到Excel”。

提前致谢!!!

1 个答案:

答案 0 :(得分:1)

我认为你在谈论dxDataGrid所以请使用导出/文本,如下面的示例代码所示

$("#datagrid").dxDataGrid({   
    "export": {
        "enabled": true,
        "fileName": "DataGridCusomText",
        "texts": {
            "exportAll": "Export everything",
            "exportSelectedRows": "Export only selected",
            "exportTo": "Export to excel or word"
        }
    }
});

如下图所示

enter image description here