2012-10-30 2 views
0

fiddle업데이트 패널 후 스팬 ID가 업데이트 패널 <br> 내가받지 못했습니다 범위 ID를 새로 고침 한 후 업데이트 패널에

내 테이블을 새로 못하고.

$(".csstablelisttd").live('mousedown', function (e) 
       { 
        clearFields(); 

        //This line gets the index of the first clicked row. 
        lastRow = $(this).closest("tr")[0].rowIndex; 

        var rowIndex = $(this).closest("tr").index(); 
        colIndex = $(e.target).closest('td').index(); 
    var id =$('.csstextheader').find('td').eq(colIndex).find('span').attr('id'); 

}); 
<table id="contentPlaceHolderMain_tableAppointment" cellspacing="1" width="100%" bgcolor="#cccccc"> 
     <tr Class="csstextheader"> 
      <td class="csstextheader" width="70px"> 
             </td> 
      <td class="csstextheader" width="70px"> 
              <b>Time Slot&nbsp;</b> 
             </td> 
      <td ID="9"><span id=9>CR (CR1)</span></td> 
      <td ID="10"><span id=10>ES (ES1)</span></td> 
      <td ID="11"><span id=11>MR (MR1)</span></td> 
      <td ID="13"><span id=13>US (US1)</span></td> 
     </tr> 
</table> 
+0

페이지의 ID가 고유해야 함 – charlietfl

+0

예 ..................... – lax

+0

라이브 ID를 얻는 방법 – lax

답변

1

선택기가 정확하지 않습니다. 당신이

<td class="csstextheader"... 

<th... 

대신 사용할 수도 그리고 다음 코드를했을

$('tr.csstextheader').find('td').eq(colIndex).find('span').attr('id') 

사용 주

$('th').eq(colIndex).find('span').attr('id') 
+0

내 테이블을 업데이트했습니다. – lax

+0

코드를 사용하여 ID를 얻습니다. 혼란 스러움 – lax

+0

살아있는 아이디를 얻는 방법 – lax