jQuery DataTables:本地化“条目”,移动“上一个/下一个”,启用 ThemeRoller
谁能回答我的 3 个与数据表相关的问题吗?
我正在尝试在 PHP 脚本中使用 DataTables 以俄语显示我的游戏的每周玩家,但是:
- 我找不到用于本地化显示 3,558 中的 1 到 20 的选项Entry string
- 我的 First Next 1 2 3 4 5 Prev Last 按钮在 MSIE 7 和 Chrome 中太靠右了,甚至会出现水平滚动条,我怎样才能将它们移动到还剩一点吗?在 Firefox 3.6.15 中,页面看起来完全损坏了:-(
- 如何启用 jQuery UI ThemeRoller 支持?
对于我尝试过的最后一项:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript" language="javascript" src="/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#rating").dataTable( {
"bJQueryUI": true,
但它没有生成漂亮的表格。
谢谢您的帮助! 亚历克斯
could anyone please answer my 3 DataTables-related questions?
I'm trying to use DataTables in the PHP script displaying weekly players of my game in Russian language, but:
- I can't find the option for localizing the Showing 1 to 20 of 3,558 entries string
- My buttons for First Next 1 2 3 4 5 Prev Last are way too the right in MSIE 7 and Chrome and even make the horizontal scrollbar appear, how could I move them to the left a bit? In Firefox 3.6.15 the page looks completely broken :-(
- How do you enable the jQuery UI ThemeRoller support?
For the last item I've tried:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript" language="javascript" src="/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#rating").dataTable( {
"bJQueryUI": true,
but it hasn't produced the nice looking table.
Thank you for your help!
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要回答#1:
也许您可以查看以下链接
如何使用 DataTables 内部化选项
To answer #1 :
Maybe you can view following link
How to use DataTables internalisation options
回答 #3:
您已经使用该选项启用了 ThemeRoller 支持;但该选项所做的只是能够将 jQuery UI 特定的类添加到您的表中。
添加类后,您仍然需要引用 jQuery UI 样式表(下面的示例;您的样式表会有所不同)。
Themeroller 主题还将包含一堆图像,这些图像是主题的一部分,位于自定义文件夹名称的子文件夹中。您不一定需要 ThemeRoller 包生成的所有内容,因此您可以进行挑选;或者保持整个目录完整,只引用您需要的内容。服务器上只需几个字节即可将未使用的内容保留在适当的位置!
该示例似乎被缩短了一点,因此您可能已经在这样做了——但不要忘记初始化的最后一项后面不能有逗号。
To answer #3:
You have already enabled ThemeRoller Support with that option; but all the option does is enable the ability to add jQuery UI-specific classes to your table.
With the classes added, you still need to reference a jQuery UI stylesheet (sample below; yours will be different).
Themeroller themes will also have a bunch of images that are a part of the theme, located as a subfolder of custom-folder-name. You don't necessarily need everything the ThemeRoller package produces, so you can sort of pick and choose; or keep the whole directory intact and only reference what you need. It's just a few bytes on the server to keep the unused stuff in place!
The sample seems to be cut a bit short, so you might already be doing this-- but don't forget that the last item of the initialization can't have a comma after it.