문제

인덱스보기에서 고정 헤더 테이블을 만들려고합니다.2 일 후에 나는 그것에 내가 마침내 jQuery fixedheadertable Addon을 발견했고, 나는 아직도 그것을 사용할 수 없다.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 플러그인을 사용하여 내 문제를 해결했습니다.

https://github.com/jmosbech/stickytableheaders

다른 팁

귀하의 질문에는 문제가 무엇인지 제대로 분석 할 수있는 세부 사항이 없습니다.그러나 이것들을 시도하고 그것이 도움이되는지 확인하십시오.

Application.js가 require_tree가 있습니까?또한 Application.js

의 마지막에 my_js_coffee_file을 추가하십시오.

ex :

//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require jquery.fixedheadertable
//= require my_js_coffee_file
.

또는 또는 operation.js 파일 자체에서 동일한 것을 코드화 할 수도 있습니다.그리고 실행을 시도하십시오.콘솔 로그를 확인하여 오류가 발생하는지 확인하십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top