{hero}

language.stateRestore.creationModal

自:StateRestore 1.0.0 起

設定在建立模式視窗中顯示的元素的文字。
請注意 - 此屬性需要 DataTables 的 StateRestore 擴充功能。

說明

這是一個物件,包含完全自訂建立模式視窗所需的所有語言選項。物件中的所有語言選項都將透過 i18n() 函式傳遞。

類型

物件

說明

一個包含建立模式視窗(使用 stateRestore.creationModal 啟用)中使用的所有字串的物件。

預設值

  • 值:物件

此語言選項的預設值是一個物件,其中包含允許建立模式視窗中所有文字國際化的字串。此物件的預設值如下。

{
    button: 'Create',
    columns: {
        search: 'Column Search:',
        visible: 'Column Visibility:'
    },
    length: 'Page Length:'
    name: 'Name:',
    order: 'Sorting:',
    paging: 'Paging:',
    scroller: 'Scroll Position:',
    search: 'Search:',
    searchBuilder: 'SearchBuilder:',
    searchPanes: 'SearchPanes:',
    select: 'Select:',
    title: 'Create New State',
}

範例

變更欄位搜尋核取方塊標籤的文字

new DataTable('#myTable', {
	language: {
		stateRestore: {
			creationModal: {
				columns: {
					visible: 'Visible Columns:'
				}
			}
		}
	},
	layout: {
		topStart: {
			buttons: [
				{
					extend: 'createState',
					config: {
						creationModal: true,
						toggle: {
							columns: {
								visible: true
							}
						}
					}
				},
				'savedStates'
			]
		}
	}
});

相關

以下選項直接相關,也可能在您的應用程式開發中很有用。