如何摆脱jQuery Data Table插件的分页? [英] How to get rid of pagination of jQuery Data Table plug-in?
问题描述
如何删除jQuery 数据的分页和显示功能表?我只想要它的搜索和排序功能,而要摆脱其他功能.有什么办法吗?
How can I remove the pagination and show features of a jQuery Data Table ? I only want the searching and sorting features of it and want to get rid the other features. Is there any way?
推荐答案
如果您使用的是无jQuery UI主题,则可以这样做
You can do it like this if you are using without jQuery UI themes
$(document).ready( function() {
$('#example').dataTable( {
"sDom": 'frt' // only show search.. processing.. and table
});
});
http://live.datatables.net/iqewoh/2/edit#preview
使用jQuery UI主题
with jQuery UI Theme
$(document).ready( function() {
$('#example').dataTable( {
"sDom": '<"H"f>rt' // only show search.. processing.. and table
});
});
<p>"H" lfr> t"F" ip. ==在页眉中放置lfr
..表..然后在页脚中放置ip
<"H"lfr>t<"F"ip> == In header put lfr
.. table .. then footer put ip
允许以下选项:
The following options are allowed:
'l'-更改长度
'f'-过滤输入
不是'-桌子!
'i'-信息
'p'-分页
'r'-处理
允许以下常量: 'H'-jQueryUI主题标头"类("fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
The following constants are allowed: 'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
'F'-jQueryUI主题页脚"类("fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
预期使用以下语法: '<'和'>' -div元素
The following syntax is expected: '<' and '>' - div elements
'<"class"和'>' -带有课程的div
'<"class" and '>' - div with a class
'<#id"和'>' -具有ID的div
'<"#id" and '>' - div with an ID
默认值:lfrtip(当bJQueryUI为false时)或<"H" lfr> t" F" ip (当bJQueryUI为true时)
Default: lfrtip (when bJQueryUI is false) or <"H"lfr>t<"F"ip> (when bJQueryUI is true)
这篇关于如何摆脱jQuery Data Table插件的分页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!