Jquery Datatable
DataTables(http://www.datatables.net/)是我目前项目用到的正在研究学习的技术,主要功能是给表格提供解决方案。初学者,会随着学习深入持续更新。
Jquery DataTables的特性:
可变长度分页;动态过滤;多列排序,带数据类型检测功能;列宽度的智能处理;从多种数据源获取数据(DOM,js Array, ajax file, server-side returning);滚动配置属性;完整国际化支持; jquery UI ThemeRoller支持;经历了个2600多个单元测试,相当牢固;有为数不少的插件支持;免费的;状态保存能力;支持隐藏列;动态创建表格的能力;自动ajax数据加载;自定义DOM位置;单列过滤(这个与前面的过滤有区别么?);多种分页器;无损的DOM交互;参与排序的列高亮;高级数据源配置;扩展的插件支持功能;可以用css完全配置表象;丰富的文档; 110多个例子;对Adobe AIR的完全支持。
>>零配置引入:
1 $(document).ready(function() { 2 $(‘#example‘).DataTable(); 3 } );
>>特性的开关:
1 $(document).ready(function() { 2 $(‘#example‘).dataTable( { 3 "paging": false, //关闭自动分页 4 "ordering": false, //关闭自动排序功能 5 "info": false //关闭页面统计信息功能 6 } ); 7 } );
特性:
Feature control DataTables‘ smart column width handling 自动宽 |
|
Feature control deferred rendering for additional speed of initialisation. |
|
Feature control table information display field |
|
Use markup and classes for the table to be themed by jQuery UI ThemeRoller. |
|
Feature control the end user‘s ability to change the paging display length of the table. |
|
Feature control ordering (sorting) abilities in DataTables. |
|
Enable or disable table pagination. 自动分页 |
|
Feature control the processing indicator. |
|
Horizontal scrolling |
|
Vertical scrolling |
|
Feature control search (filtering) abilities |
|
Feature control DataTables‘ server-side processing mode. |
|
State saving - restore table state on page reload |
特性饮用比较简单。取值只有 true or false。
>>国际化 Internationalisation DataTables 支持多种语言,相关语言json文件可以从remote调用
$(document).ready(function() { $(‘#example‘).dataTable( { "language": { "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json" } } ); } );
language.url
$(document).ready(function() { $(‘#example‘).dataTable( { "language": { "aria": { "sortDescending": " - click/return to sort descending" } } } ); } );
language.aria.sortAscending
ok,写两个并不是抽筋。只是想强调一下文档和代码的对应格式
好的 国际化
Language strings used for WAI-ARIA specific attributes |
|
Language strings used for WAI-ARIA specific attributes |
|
Language strings used for WAI-ARIA specific attributes |
|
Decimal place character |
|
Table has no records string |
|
Table summary information display string |
|
Table summary information string used when the table is empty or records |
|
Appended string to the summary information when the table is filtered |
|
String to append to all other summary information strings |
|
Page length options string |
|
Loading information display string - shown when Ajax loading data |
|
Pagination ‘first‘ button string |
|
Pagination ‘last‘ button string |
|
Pagination ‘next‘ button string |
|
Pagination ‘previous‘ button string |
|
Pagination specific language strings |
|
Processing indicator string |
|
Search input string |
|
Search input element placeholder attribute |
|
Thousands separator |
|
Load language information from remote file |
|
Table empty as a result of filtering string |
|
Language configuration options for DataTables |
>> 列控制 DataTables 提供了丰富的列控制参数。其调配方法与国际化一致
Assign a column definition to one or more columns. |
|
Set column definition initialisation properties. |
|
Cell type to be created for a column |
|
Class to assign to each cell in the column |
|
Add padding to the text content used when calculating the optimal with for a table. |
|
Cell created callback to allow DOM manipulation |
|
Set the data source for the column from the rows data object / array |
|
Set default, static, content for a column |
|
Set a descriptive name for a column |
|
Enable or disable ordering on this column |
|
Define multiple column ordering as the default order for a column |
|
Live DOM sorting type assignment |
|
Order direction application sequence |
|
Render (process) the data for use in the table |
|
Enable or disable filtering on the data in this column |
|
Set the column title |
|
Set the column type - used for filtering and sorting string processing |
|
Enable or disable the display of this column |
|
Column width assignment |
|
Set column specific initialisation properties. |
>>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。