rows().indexes()
自:DataTables 1.10 起
取得選取列的列索引。
描述
DataTables 將列和欄的資料儲存在內部索引中,以便快速排序、搜尋等。有時知道這些索引會很有用,因為它們可以用於row()
、column()
以及其他使用選取器的 API 方法中的有效選取器。
此方法用於擷取選取列的索引,然後這些索引可以用作更新資料的選取器的一部分。
類型
範例
在列選取器中使用索引來取得資料
var table = new DataTable('#myTable');
var rows = table.rows('.selected').indexes();
var data = table.rows(rows).data();
// Note that you could use `table.rows( '.selected' ).data() here as well!
// This is just an example showing how indexes can be used!
相關
以下選項直接相關,也可能在您的應用程式開發中很有用。