{hero}

stateRestore.states()

自:StateRestore 1.0.0 開始

從 StateRestore 取得狀態。
請注意 - 這個屬性需要 DataTables 的 StateRestore 擴充功能。

描述

此方法提供檢索由 StateRestore 擴充功能管理的狀態的能力。

stateRestore.states() 接受一個參數,identifier。這是一個字串陣列,用於識別整個 StateRestore 中的狀態。

返回一個包含所需狀態的 DataTables API 實例。此方法主要用於鏈接。

類型

function stateRestore.state()

描述

從 StateRestore 擴充功能檢索儲存的狀態。

參數
回傳

返回包含所需狀態的 DataTables API,以便可以進行鏈接。

範例

取得名為「New State」和「Old State」的狀態

var table = new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['createState', 'savedStates']
		}
	}
});

table.stateRestore.states(['New State', 'Old State']);

相關

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