2014-02-20 1 views
1

열 정렬을 사용하지 않으려 고 jquery plugin table sorter를 사용하고 있습니다. 나는 시도했다 :Jquery tablesorter는 열 정렬을 비활성화 할 수 없습니다.

data-sorter="false" //not working 
class="{ sorter: false }" // not working 
class="sorter-false" // not working 

당신은 여기 plunkr 볼 수 있습니다 http://plnkr.co/edit/ZJINXSTBnsyd1sGpE1Ut?p=preview

+0

직장 이상 공유 옵션의 모든 Updated Plunker하지만, 모든 작업, 어쩌면이 혼란이 어디서 왔을 까? 'class = "{sorter : false}"'는 메타 데이터 플러그인이로드 된 경우에만 작동합니다. – Mottie

답변

1

테이블 순서에 매개 변수가 코드와 나를 위해 일한으로 다음과 같은 추가 :

$('.dirf_tbl').tablesorter({ 

    headers: { 
     // disable sorting of the first column (we start counting at zero) 
     0: { 
     // disable it by setting the property sorter to false 
     sorter: false 
     } 
    } 
    }); 
+0

당신의 솔루션이 작동하지만 클래스 메소드를 사용하는 것을 선호합니다. 그러나 그것은 다운로드 우편 번호가 오래된 저장소를 가지고있는 것 같습니다 – Tropicalista

0

당신은 사용할 수 있습니다 headersoption :이 경우

function tblSortOn(){ 
    $('.dirf_tbl').addClass('tablesorter'); 

    $(".dirf_tbl").tablesorter({ 
     // pass the headers argument and assing a object 
     headers: { 
      // assign the secound column (we start counting zero) 
      1: { 
       // disable it by setting the property sorter to false 
       sorter: false 
      }, 
      // assign the third column (we start counting zero) 
      2: { 
       // disable it by setting the property sorter to false 
       sorter: false 
      } 
     } 
    }); 
} 

, Last NameAge이 사용 중지됩니다. 원래 내 [tablesorter에 포크 (http://mottie.github.io/tablesorter/docs/)에서

+0

이전 의견에 말했듯이, 나는 오래된 vrsion이 다운로드에 압축되어 있다고 생각합니다. 예제 사이트에서 사용 된 코드를 복사/붙여 넣기하면 멋지게 작동합니다. – Tropicalista

관련 문제