2014-05-09 2 views
0

안녕하세요 내가 내 프로젝트에서 자바 스크립트 파일 사이의 충돌 문제가있는 파일을 명확하게 문제는 내가 그것을 정렬 할 수있는 모든 사용자가 부트 스트랩 테이블에 표시되는 내 관리자 패널에서충돌이

을 다음과 같다 . 페이지 매김 시스템도 있습니다. 좋게 보입니다.

시스템을 원합니다 => 전체 행을 버튼으로 만들고 행을 클릭하면 숨겨진 정보가 "각 행 아래에 숨어 있음"으로 표시되어 사용자 정보를 입력합니다.

이 코드는 테이블 파일

$(document).ready(function() { 

      /* 
      * Initialse DataTables, with no sorting on the 'details' column 
      */ 
      var oTable = $('#example').dataTable({ 
       "aoColumnDefs" : [{ 
        "bSortable" : false, 
        "aTargets" : [0] 
       }], 
       "aaSorting" : [[1, 'asc']] 
      }); 
      $('#example tbody td ').live('click', function() { 
       var nTr = $(this).parents('tr')[0]; 
       if (oTable.fnIsOpen(nTr)) { 
        /* This row is already open - close it */ 
        this.src = "../examples_support/details_open.png"; 
        oTable.fnClose(nTr); 
       } else { 
        /* Open this row */ 
        this.src = "../examples_support/details_close.png"; 
        oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details'); 
       } 
      }); 
     }); 
+1

그래서 정확히 무엇이 문제입니까? 네가 뭘 할 때, 뭘 보지? 디버그 콘솔에 오류가 있습니까? – jfriend00

+0

테이블에이 코드를 추가하면 테이블의 첫 번째 페이지가 올바르게 작동하지만 다른 코드는 작동하지 않습니다. –

+0

콘솔에서 오류가 발생 했습니까? – ahalya

답변

1

당신은 페이지에서 호출 모든 데이터 테이블에 아래 코드를 삽입에 추가됩니다 link 및 SB 관리 V2를 사용하고 있습니다. 예를 들어

$('#example tbody td ').live('click', function() { 
       var nTr = $(this).parents('tr')[0]; 
       if (oTable.fnIsOpen(nTr)) { 
        /* This row is already open - close it */ 
        this.src = "../examples_support/details_open.png"; 
        oTable.fnClose(nTr); 
       } else { 
        /* Open this row */ 
        this.src = "../examples_support/details_close.png"; 
        oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details'); 
       } 
      }); 

:

<table id="example"> 
<tr> 
<td></td> 
</tr> 
</table> 
<script> 
$('#example tbody td ').live('click', function() { 
        var nTr = $(this).parents('tr')[0]; 
        if (oTable.fnIsOpen(nTr)) { 
         /* This row is already open - close it */ 
         this.src = "../examples_support/details_open.png"; 
         oTable.fnClose(nTr); 
        } else { 
         /* Open this row */ 
         this.src = "../examples_support/details_close.png"; 
         oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details'); 
        } 
       }); 
</script> 

또는 라이브 대신에 사용.

감사합니다.