2012-09-11 6 views
0

데이터 테이블 colreorder를 사용할 때 마지막 열을 수정하는 방법은 무엇입니까?마지막 열 datatable colreorder 고정

나는 그 아래가 작동하지 않습니다 시도 :

var oTable = $('#example').dataTable({ 
       "sDom": 'R', 
       "oColReorder": { 
        "iFixedColumns":[-1]  
       } 
      }); 
+0

귀하의 질문은 명확하지 않습니다. 사람들은 당신이 요구하는 것에 대해 가정하거나 추측해야합니다. – allen213

답변

0

나는 아래의 해결책을 발견 :

<th >First</th> 
<th >2</th> 
<th >3</th> 
<th >4</th> 
<th ><div id="theLast">last</div></th> 
: 나는 아래 같은 테이블의 마지막 일에 사업부를 추가 한

$(document).ready(function() { 
      $("#theLast").bind("mousedown", function (event) { 
       event.stopPropagation(true); 
       return; 
      } 
      ); 

      var oTable = $('#example').dataTable({ 
       "sDom": 'R' 
     }); 

    }); 

마지막 열을 사용할 수 없습니다이 내가 같이 :

하고 다음 스크립트를 호출 colReorder 기능. 수정

기능 : _fnMouseUp

내가 쓴 :

if (this.s.mouse.toIndex == 4) { // 4 means last column index 
        e.stopPropagation(true); 
        return null; 
       } 
       else 
       /* Actually do the reorder */ 
       this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex, this.s.mouse.toIndex); 

대신 는 내부 ColReorder.js은 아래와 같은 파일 내가 코드를 수정이 마지막 열 이후 감소되는 다른 열을 사용하지 않으려면

this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex, this.s.mouse.toIndex);