stateRestore.state()
起始版本:StateRestore 1.0.0
從 StateRestore 取得狀態。
請注意 - 此屬性需要 DataTables 的 StateRestore 擴充功能。
描述
此方法提供擷取由 StateRestore 擴充功能管理的狀態之能力。
stateRestore.state()
接受一個引數 identifier
。此字串用於在 StateRestore 中識別狀態。
傳回一個包含所需狀態的 DataTables API 實例。此方法主要用於鏈式呼叫。
類型
function stateRestore.state()
- 描述
從 StateRestore 擴充功能擷取已儲存的狀態。
- 參數
名稱 類型 選用 1 identifier
否 用於識別此狀態的字串。
- 傳回
傳回一個包含所需狀態的 DataTables API,以便可以進行鏈式呼叫。
範例
取得名為「New State」的狀態
var table = new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['createState', 'savedStates']
}
}
});
table.stateRestore.state('New State');
相關
以下選項直接相關,可能在您的應用程式開發中也很有用。