2012-06-01 2 views
5

jquery tablesorting plugin의 특정 열에 대한 정렬을 무시할 수 있습니까?특정 열 테이블 목록에서 정렬을 무시합니다.

그래서 기본적으로 페이지가로드 될 때 이미지에 포함되어있는 자바 스크립트 처리를 수행하기 때문에 "정렬"을 수행하지 않아도됩니다. 따라서 정렬이 상당히 느려집니다. 여기

내 코드입니다 :

<script type="text/javascript"> 
jQuery(document).ready(function() { 

    jQuery("table").tablesorter({ 


}); 

});

puts "<table cellspacing=\"1px\" class=\"tablesorter\" >" 
    puts "<thead>" 
    puts "<tr>" 
    puts "<th>Search</th>" 
    puts "<th>Sub-App</th>" 
    puts "<th>Division</th>" 
    puts "<th>Region</th>" 
    puts "<th>Market</th>" 
    puts "<th>Language</th>" 
    puts "<th>Function</th>" 
    puts "<th>LOB</th>" 
    puts "<th>Term</th>" 
    puts "<th>Center</th>" 
    puts "</tr>" 
    puts "</thead>" 
    puts "<tbody>" 

    puts "<tr>" 
    puts "<td id=\"$cellID\">" 
    puts "<img src=\"images/magnifier.gif\" style=\"cursor:pointer\" onclick=\"showRouting({'spec':'${specific}', 'id':'${mkt_id}', 'name':'${mkt_name}', 'xfer':'${xfertype}', 'cell':'${cellID}'})\"</img>" 
    puts "</td>" 
    puts "<td>$level</td>" 
    puts "<td>$div_name</td>" 
    puts "<td>$reg_name</td>" 
    puts "<td>$link</td>" 
    puts "<td>$lang</td>" 
    puts "<td>$func</td>" 
    puts "<td>$lob</td>" 
    puts "<td>$term</td>" 
    puts "<td>$ctr_name</td>" 
    puts "</tr>" 

    puts "</tbody>" 
    puts "</table>" 

답변

7

신경 쓰지 마십시오. 다음은 내 질문에 대한 답변입니다. 그 열에 이미지를 표시하기 때문에 더 빨리 정렬 할 수 없습니다.

headers: { 
      0: { sorter: false } 

     } 
6

정렬하고 다음에 당신이 원하지 않는 열의 </td> 헤더에 noSort 클래스를 추가 :

$(document).ready(function() { 

    // Get Headers with Class noSort // 
    var theHeaders = {} 
    $(this).find('th.noSort').each(function(i,el){ 
     theHeaders[$(this).index()] = { sorter: false }; 
    }); 

    // Initialize Table Sorter // 
    $("table").tablesorter({ 
     headers: theHeaders 
    }); 
}); 

을 나는 희망이 도움이!

10

documentation 당, 당신이 지금 class="sorter-false"

+0

를 사용하지만 신중하게 할 수 있습니다, 그것은 특정 버전 이후 지원되는거야, 아마 당신은 이전을했고 lib 디렉토리를 업데이트해야 – Tebe

관련 문제