2017-09-26 83 views
1

我想在我的按鈕「導出爲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'。

在此先感謝!

+0

看我認爲這裏沒有足夠的信息來創建答案。網格背後的代碼是什麼?怎麼樣的HTML?那麼網格模板呢? – theGleep

回答

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

+0

謝謝!這正是我所期待的。 – ABT

相關問題