default lfrtip (when bJQueryUI is false) or <"H"lfr>t<"F"ip> (when bJQueryUI is true)
這是用于定義DataTable布局的一個強大的屬性,另開專門文檔來補充說明吧
sPaginationType
'full_numbers' or 'two_button', default 'two_button'
用于指定分頁器風格
sScrollXInner
string default 'disabled'
又是水平滾動相關的,沒搞懂啥意思
DataTable支持如下回調函數?
回調函數名稱
參數
返回值
默認
功能
fnCookieCallback
1.string: Name of the cookie defined by DataTables 2.object: Data to be stored in the cookie 3.string: Cookie expires string 4.string: Path of the cookie to set
string: cookie formatted string (which should be encoded by using encodeURIComponent())
null
當每次cookies改變時,會觸發這個函數調用
fnDrawCallback
無
無
無
在每次table被draw完后調用,至于做什么就看著辦吧
fnFooterCallback
1.node : "TR" element for the footer 2.array array strings : Full table data (as derived from the original HTML) 3.int : Index for the current display starting point in the display array< 4.int : Index for the current display ending point in the display array 5.array int : Index array to translate the visual position to the full data array
無
無
用于在每次重畫的時候修改表格的腳部
fnFormatNumber
1.int : number to be formatted
String : formatted string for DataTables to show the number
有默認的
用于在大數字上,自動加入一些逗號,分隔開
fnHeaderCallback
1.node : "TR" element for the header 2.array array strings : Full table data (as derived from the original HTML) 3.int : Index for the current display starting point in the display array 4.int : Index for the current display ending point in the display array 5.array int : Index array to translate the visual position to the full data array
無
無
用于在每次draw發生時,修改table的header
fnInfoCallback
1.object: DataTables settings object 2.int: Starting position in data for the draw 3.int: End position in data for the draw 4.int: Total number of rows in the table (regardless of filtering) 5.int: Total number of rows in the data set, after filtering 6.string: The string that DataTables has formatted using it's own rules
string: The string to be displayed in the information element.
1.node : "TR" element for the current row 2.array strings : Raw data array for this row (as derived from the original HTML) 3.int : The display index for the current table draw 4.int : The index of the data in the full list of rows (after filtering)
node : "TR" element for the current row
無
當創建了行,但還未繪制到屏幕上的時候調用,通常用于改變行的class風格
fnServerData
1.string: HTTP source to obtain the data from (i.e. sAjaxSource) 2.array objects: A key/value pair object containing the data to send to the server 3.function: Function to be called on completion of the data get process that will draw the data on the page.
void
$.getJSON
用于替換默認發到服務端的請求操作
fnStateLoadCallback
1.object:oSettings - DataTables settings object 2.object:oData - Object containing information retrieved from the state saving cookie which should be restored. For the exact properties please refer to the DataTables code.
Boolean - false if the state should not be loaded, true otherwise
無
在cookies中的數據被加載前執行,可以方便地修改這些數據
fnStateSaveCallback
1.object:oSettings - DataTables settings object 2.String:sValue - a JSON string (without the final closing brace) which should be stored in the state saving cookie.
String - the full string that should be used to save the state