2015-02-10 68 views
0

我有一张桌子,在其中一列上,我希望在mouseover或mouseenter上显示一些数据,但它不是以角度工作。ng-mouseover不显示数据

<table id="ls-shop-rel-list" class="row ls-shop-list packages" data-per-page="40"> 
    <thead class=""> 
    <tr class="row hidden-xs"> 
       <th>Apply?</th> 
       <th><span class="down" data-column="bank.name">Bank</span></th> 
       <th><span class="down" data-column="package_name">Package</span></th> 
       <th><span class="down" data-column="info_name">Info</span></th> 
       <th><span class="down" data-column="monthly_payment">Monthly<br>RM</span></th> 
       <th><span class="active up" data-column="interest_rate">Interest<br>Rate</span></th> 
       <th><span class="down" data-column="maximum_tenure">Max<br>Tenure</span></th> 
       <th><span class="down" data-column="maximum_finance">Max<br>Margin</span></th> 
       <th><span class="down" data-column="lock_in">Lock in<br>Period</span></th> 
       <th><span class="down" data-column="is_flexi">Full Flexi<br>Loan?</span></th> 
       </tr> 
      </thead> 
      <tbody> 

       <tr class="row hidden-xs" ng-repeat="data in loans"> 
       <td><input type="checkbox" class="hidden-xs" id="{{data.id}}"/> 
        <img class="ls-decoration hidden-lg hidden-md hidden-sm" src="http://cdn.app.com.my/assets/button-selected-large-a3480a3ee5f72bf6937d0b95ab38b347.png"> 
       </td> 
       <td> 
        <img style="max-width: 90px; max-height: 35px" alt="{{data.bank_name}}" src="http://static.app.com.my/assets/common/banks/{{data.bank_image}}"> 
       </td> 
       <td>{{data.name}}</td> 
       **<td><img class="tip" src="http://static.loanstreet.com.my/assets/common/glasses.png" ng-mouseover="data.notes"></td>** 
       <td>{{data.monthly}}</td> 
       <td>{{data.effective_rate}}%</td> 
       <td>{{data.maximum_tenure}}yrs</td> 
       <td>{{data.maximum_finance}}%</td> 
       <td>{{data.lock_in_period}}</td> 
       <td>{{data.is_flexi}}</td> 
       </tr> 

      </tbody> 
      </table> 

在突出显示的列上,我希望鼠标悬停为它显示data.notes中的数据,但它似乎没有工作。任何人的线索?

回答

1

你的NG-鼠标悬停应该是这样的:

ng-mouseover="myMouseOverFuntion()" 

,并在你的控制器:

$scope.showDataNotes=false; 
$scope.myMouseOverFuntion=function(){ 
    $scope.showDataNotes=true; 
} 

最后,在你的HTML:

<div ng-show="showDataNotes">{{data.notes}}</div> 
0

我认为,CSS将这里是更好的选择

<td class="data-notes"><img class="tip" src="http://static.loanstreet.com.my/assets/common/glasses.png"><span class="notes">{data.notes}</span></td> 

然后

td.data-notes span.notes{ 
    display: none; 
} 
td.data-notes:hover span.notes{ 
    display: inline; 
} 
0

谢谢你们的答复。但我解决它像这样

<img class="tip" src="http://static.loanstreet.com.my/assets/common/glasses.png" popover="{{data.notes}}" popover-trigger="mouseenter"> 

角度UI,引导酥料饼的解决了这个问题对我,但你必须添加

<script src="scripts/ui-bootstrap-tpls-0.12.0.min.js"></script> 

您main.html中的文件则u可以调用酥料饼的组成部分。