jquery DataTables 插件:服务器端数据,使用长度菜单并显示“全部”与-1?
在长度菜单示例中,我们看到选项设置如下: http://www.datatables.net/examples/advanced_init/length_menu.html
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
然而,当我在服务器端尝试这种方法时,选择“全部”时会失败。 有没有人遇到过这个问题或者熟悉这个问题 如何处理这种情况?
In the length menu example, we see the options set as follows:
http://www.datatables.net/examples/advanced_init/length_menu.html
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
});
Yet when I try this approach server-side, it fails when selecting "All".
Has anyone run across this issue before or familiar with
how to handle this scenario?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在 dataTable 论坛中发布您的问题会更好...在那里您会得到更多回复..这里是该链接 DataTable Forum
你也可以尝试这样的事情......
it will be better if you post your question in dataTable forum...there you will get more response..here is link for that DataTable Forum
you can try something like this also...
该问题已在数据表论坛上得到解答。
“-1”可以被认为是“虚拟”值
需要在服务器端进行处理。
(伪代码:如果@numberofrows = -1,则选择全部)
http://datatables.net/forums/comments.php?DiscussionID=3959&page=1#Comment_16445
The question was answered on the datatables forum.
The "-1" can be thought of as a "dummy" value
that needs to be processed server-side.
(pseudo-code: if @numberofrows = -1, then select all)
http://datatables.net/forums/comments.php?DiscussionID=3959&page=1#Comment_16445