1、DataTables的默認配置
$(document).ready(function() {$(‘#example').dataTable();} );示例:http://www.guoxk.com/html/DataTables/Zero-configuration.html
2、DataTables的一些基礎屬性配置
“bPaginate”: true, //翻頁功能
“bLengthChange”: true, //改變每頁顯示數據數量
“bFilter”: true, //過濾功能
“bSort”: false, //排序功能
“bInfo”: true,//頁腳信息
“bAutoWidth”: true//自動寬度

示例:http://www.guoxk.com/html/DataTables/Feature-enablement.html
3、數據排序
$(document).ready(function() {$(‘#example').dataTable( {“aaSorting”: [[ 4, "desc" ]]} );} );從第0列開始,以第4列倒序排列
示例:http://www.guoxk.com/html/DataTables/Sorting-data.html
4、多列排序
示例:http://www.guoxk.com/html/DataTables/Multi-column-sorting.html
5、隱藏某些列
$(document).ready(function() {$(‘#example').dataTable( {“aoColumnDefs”: [{ "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] },{ “bVisible”: false, “aTargets”: [ 3 ] }] } );} );示例:http://www.guoxk.com/html/DataTables/Hidden-columns.html
6、改變頁面上元素的位置
$(document).ready(function() {$(‘#example').dataTable( {“sDom”: ‘<”top”fli>rt<”bottom”p><”clear”>'} );} );//l- 每頁顯示數量//f 
主站蜘蛛池模板:
噶尔县|
讷河市|
偏关县|
盘山县|
民勤县|
烟台市|
扎鲁特旗|
阿拉尔市|
瑞昌市|
黑水县|
达拉特旗|
无锡市|
武宣县|
天峻县|
横山县|
禄丰县|
独山县|
织金县|
奉新县|
彭阳县|
成武县|
西吉县|
新密市|
新邵县|
泰来县|
南雄市|
白河县|
赤峰市|
香港
|
辛集市|
兴城市|
普宁市|
石渠县|
凤凰县|
宁海县|
新化县|
惠东县|
湖州市|
崇礼县|
通道|
高邑县|