2011-08-25 4 views
1

툴팁이 잘 작동하는 것보다 내 링크가 템플릿 밖에 있다면 JQuery 템플릿이 전혀 작동하지 않는 경우. 많은 예제를 시도했지만 성공하지 못했습니다. 그리드는 페이지 사용은 아래와 같이 라이브JQuery 툴팁이 Jquery 템플릿을 사용하여 작동하지 않습니다. 도움이 필요합니다

<script id="cellTemplate" type="text/x-jQuery-tmpl"> 
    <tr class="gridRowCursor" > 
     <td class="cellTd "> 
      <input type="checkbox" id="deleteCb" /> 
      <input type="hidden" id="Id_ + ${Id}" class="idField" value="${Id}" /> 
     </td> 
     <td class="cellTd"> 
      <input id="index" name="index" class="numberField" type="text" value="${IndexOrder}" /> 
     </td> 
     <td class="cellTdLeft" style="font-size:11px;"> 

      <a class="hello" href="#">{{html DisplayName}}</a> 

      <div id="tooltip" style="display: none"> 
       <div> 
        {{html UrlName}} 
       </div> 
      </div> 



     </td> 
     <td class="cellTd "> 
      <input type="checkbox" id="activeCb" {{if Active}} checked{{/if}} /> 
     </td> 
    </tr> 
    <tr id="${Id}" class="gridRow" style="display: none;"> 
     <td class="cellTdLeft" colspan="5" style="padding-left: 15px; font-size:11px;"> 
      {{html UrlName}} 
     </td> 
    </tr> 
</script> 


<span class="instructions">Only numeric value is allowed in IndexOrder textbox.</span> 
<div class="gridDiv"> 
<table id="set1" class="gridTable" cellspacing="0" cellpadding="0" > 
    <thead> 
     <tr class="gridTitleRow"> 
      <td class="iconLink width36">Delete</td> 
      <td class="iconLink width60">Sort Order</td> 
      <td class="iconLink width500">Display Name</td> 
      <td class="iconLink widthAuto">Active</td> 
     </tr> 
    </thead> 
    <tbody> 
    </tbody> 
</table> 
</div> 

ReloadGrid(); 

$(".hello").tooltip({ 
    track: true, 
    delay: 0, 
    showURL: false, 
    fade: 250, 
    bodyHandler: function() { 
     return $($(this).next().html()); 
    }, 
    showURL: false 
}); 

를로드 한 후

다음은 JS 파일의 코드

입니다. 작동 안함?

$(".hello").live("tooltip", function() { 
    track: true, 
delay: 0, 
showURL: false, 
fade: 250, 
bodyHandler: function() { 
    return $($(this).next().html()); 
}, 
showURL: false 

}); 

답변

0

시도의 $ (". 안녕하세요"). 살 (기능 ("툴팁") {대신 $ (". 안녕하세요")의. 툴팁 ({

는 인사 클래스 요소는 아니므로 돔의 일부가로드되었을 때, 코드는 아마도 아직 존재하지 않는 것을 연결하려고 시도하고있을 것입니다. 라이브 메소드는 클래스 hello를 가진 미래의 모든 요소가 툴팁 이벤트를 추가하게합니다.

+0

귀하의 제안을 사용하여 내 질문을 편집했습니다. 그게 맞습니까? 그 도구 팁은 그것을 지원하지 않습니다. 귀하의 제안과 함께 전체 툴팁 코드를 게시 할 수 있습니까? – Pirzada

관련 문제