具有不同宽度的rails固定头表
-
21-12-2019 - |
题
我试图在我的索引视图中创建一个固定的标头表。经过2天我就可以了,我终于找到了jQuery fixedheadertable
插件,我仍然不能使用它。我想我做错了什么,因为这是我第一次使用jQuery。这就是我所做的:
添加了文件 jquery.fixedheadertable.js
到 \app\assets\javascripts
在 application.js
:
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require jquery.fixedheadertable
..
..
在 my_js_coffee_file
:
$ ->
$("#id_of_my_index_table").fixheadertable({
caption : 'My header is fixed !',
height : 200
});
也试过:
$ ->
$('#id_of_my_index_table').fixedHeaderTable('show');
完全没有变化。..这里怎么了?
谢谢.
解决方案 2
使用 stickyTableHeaders
JQuery插件解决了我的问题。
其他提示
你的问题没有细节来正确分析什么是错的。但是,尝试这些,看看它是否有帮助。
做你的应用程序。js中有require_tree?另外,尝试在应用程序的末尾添加my_js_coffee_file。js的
前 :
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require jquery.fixedheadertable
//= require my_js_coffee_file
或者,您也可以在应用程序内部编写相同的代码。js文件本身。然后试试跑步。检查您的控制台日志以查看弹出的错误。
不隶属于 StackOverflow