//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 - 过滤输入
//t - 表单Table
//i - 信息
//p - 翻页
//r - pRocessing
//< and > - div elements
//<"class" and > - div with a class
//Examples: <"wrapper"flipt>, <lf<t>ip>
//示例:http://www.guoxk.com/html/DataTables/DOM-positioning.html
//7、状态保存,使用了翻页或者改变了每页显示数据数量,会保存在cookie中,下回访问时会显示上一次关闭页面时的内容。
$(document).ready(function() {
$('#example').dataTable( {
"bStateSave"true
} );
} );
//示例:http://www.guoxk.com/html/DataTables/State-saving.html
//8、显示数字的翻页样式
$(document).ready(function() {
$('#example').dataTable( {
"sPaginationType""full_numbers"
} );
} );
//示例:http://www.guoxk.com/html/DataTables/Alternative-pagination-styles.html
//9、水平限制宽度
$(document).ready(function() {
$('#example').dataTable( {
"sScrollX""100%",
"sScrollXInner""110%",
"bScrollCollapse"true
} );
} );
//示例:http://www.guoxk.com/html/DataTables/Horizontal.html
//10、垂直限制高度
//示例:http://www.guoxk.com/html/DataTables/Vertical.html
//11、水平和垂直两个方向共同限制
//示例:http://www.guoxk.com/html/DataTables/HorizontalVerticalBoth.html
//12、改变语言
$(document).ready(function() {
$('#example').dataTable( {
"oLanguage": {
"sLengthMenu""每页显示 _MENU_ 条记录",
"sZeroRecords""抱歉, 没有找到",
"sInfo""从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
"sInfoEmpty""没有数据",
"sInfoFiltered""(从 _MAX_ 条数据中检索)",
"oPaginate": {
"sFirst""首页",
"sPrevious""前一页",
"sNext""后一页",
"sLast""尾页"
},
"sZeroRecords""没有检索到数据",
"sProcessing""<img src='./loading.gif' />"
}
} );
} );
//示例:http://www.guoxk.com/html/DataTables/Change-language-information.html
//13、click事件
//示例:http://www.guoxk.com/html/DataTables/event-click.html
//14/配合使用tooltip插件
//示例:http://www.guoxk.com/html/DataTables/tooltip.html
//15、定义每页显示数据数量
$(document).ready(function() {
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
} );
//示例:http://www.guoxk.com/html/DataTables/length_menu.html

datatables使用的更多相关文章

  1. [jQuery]jQuery DataTables插件自定义Ajax分页实现

    前言 昨天在博客园的博问上帮一位园友解决了一个问题,我觉得有必要记录一下,万一有人也遇上了呢. 问题描述 园友是做前端的,产品经理要求他使用jQuery DataTables插件显示一个列表,要实现分 ...

  2. JQuery Datatables Columns API 参数详细说明

    ---恢复内容开始--- Data Tables: http://datatables.NET/ Version: 1.10.0 Columns说明 虽然我们可以通过DOM直接获取DataTables ...

  3. datatables中的Options总结(3)

    datatables中的Options总结(3) 十.ColReorder colReorder.fixedColumnsLeft 不允许x列重新排序(从左数) colReorder.fixedCol ...

  4. datatables中的Options总结(2)

    datatables中的Options总结(2) 五.datatable,列 columnDefs.targets 分配一个或多个列的列定义. columnDefs 设置列定义初始化属性. colum ...

  5. datatables中的Options总结(1)

    datatables中的Options总结(1) 最近一直研究dataTables插件,下面是总结的所有的选项内容,用了帮助学习datatables插件. 这些选项的配置在$().Datatable( ...

  6. Datatables事件

    DataTables格式化渲染加上的html代码按一般方式绑定事件可能会没效果,通过以下方式可以解决 $(document).on("click","#checkchil ...

  7. jquery Datatables 行数据删除、行上升、行下降功能演示

    Datatables 是一款jquery表格插件.它是一个高度灵活的工具,可以将任何HTML表格添加高级的交互功能. 官方网站:http://www.datatables.net Datatables ...

  8. JQuery表格插件DataTables 当前页合计功能

    公司项目表格插件使用的是DataTables,最近添加表合计功能,发现百度统一都是如图类型的代码,不知道是配置问题还是怎么了,在我的页面下根本不能用 var addd=0; $(document).r ...

  9. datatables服务器端分页要点

    背景:当要查询大量数据的时候,有datatables自身的分页,明显查询比较慢,这是要使用服务器端分页 参数:"bServerSide": true, "fnServer ...

  10. JQuery插件之Jquery.datatables.js用法及api

    1.DataTables的默认配置 $(document).ready(function() { $('#example').dataTable(); } ); 示例:http://www.guoxk ...

随机推荐

  1. 关于数据库表中的索引及索引列的CRUD

     -- 查询一个数据库表中的索引及索引列use [RuPengWangDB]GOSELECT  indexname = a.name , tablename = c. name , indexcolu ...

  2. rtc关机闹钟6 AlarmManagerService研究

    这个是 private void setLocked(int type, long when) { if (mNativeData != 0) {            // The kernel n ...

  3. js编程-面相对象

    //js面相对象编程 //定义constructor构造方法 function myFn(name,sex){ this.name = name; this.sex = sex; } //用proto ...

  4. 在Windows Live Writer中插入C# code

    平时都是用Windows Live Writer写博客,发布博客.遇到需要插入代码都是先在notepad中写好,或者是拷贝到notepad,再从notepad中拷到Windows Live Write ...

  5. 花40分钟写一个-CBIR引擎-代码公开

          浏览网页的时候发现一篇不错的文章"用Python和OpenCV创建一个图片搜索引擎的完整指南"http://python.jobbole.com/80860/.作者在浏 ...

  6. 精通D3.js学习笔记(1)基础的函数

    买了本吕大师的d3可视化.最近来学习一下,做个笔记.   1.选择元素  select(第一元素) 和selectAll(全部的元素)      类似css的选择器.也可以是dom选中的. var i ...

  7. 华东交通大学2016年ACM“双基”程序设计竞赛 1004

    Problem Description LB是个十分喜欢钻研的人,对什么事都要搞明白.有一天他看到一个公式,((a-b)*c+d*e)/f=k.他想如果给定K的值,一共有多少种不同整数的组合(a,b, ...

  8. 2016年11月30日 星期三 --出埃及记 Exodus 20:21

    2016年11月30日 星期三 --出埃及记 Exodus 20:21 The people remained at a distance, while Moses approached the th ...

  9. 2016年6月24日 星期五 --出埃及记 Exodus 14:21

    2016年6月24日 星期五 --出埃及记 Exodus 14:21 Then Moses stretched out his hand over the sea, and all that nigh ...

  10. Repeater删改

    一.Repeater删改 中心思路:点击"删除"链接,跳转到"删除"网页,在"删除"网页里面执行删除方法,然后再返回主界面,根据删除界面返回 ...