2012-12-29 2 views
0

jquery (www.datatables.net)의 DataTables 플러그인을 사용합니다. JQuery와 코드를 설치jQuery, 셀을 변환하는 데이터 테이블

name www 
n1 <a href="w1">w1</a> 
n2 <a href="w2">w2</a> 
n3 <a href="w3">w3</a> 
name www 

name www 
n1 w1 
n2 w2 
n3 w3 
name www 

becames 같은 세포를 변환하는 방법을 여기에 있습니다 :

$(document).ready(function() { 
    $('#example').dataTable(); 
    $('#example').convertCell(setCell("<a href="getCell()">getCell()</a>"));//How to put it better? 
}); 

와 HTML 코드가

<div id="dynamic"> 
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"> 
    <thead> 
     <tr> 
      <th width="15%">Name</th> 
      <th width="15%">Www</th> 
     </tr> 
    </thead> 
    <tbody></tbody> 
</table> 
</div> 

감사입니다 : 초급 데이터 테이블에

답변

0

나는 플러그인에 대해 잘 모르겠지만, 당신은 사용할 수 있습니다

$('.example').each(function(){ 
    $(this).wrap(function() { 
     return '<a href="' + $(this).text() + '" />'; 
    }); 
}); 

는 각각의 텍스트를 가리키는 링크 클래스 .example 각 요소를 포장겠습니까. '(함수 (NTD, sData로, 하나로, OData, iRow, iCol) { $ (NTD) .html 중에서 [ { "aTargets"[1] "fnCreatedCell"

+1

i는 자신에게 \t "aoColumnDefs를"발견 '+sData+' ')}} – user1929552

+0

@ user1929552 dats은 당신을 위해 일하고 있습니까? –

관련 문제