我有一个使用 ng-disabled 禁用的按钮,但该按钮即使在禁用时也显示工具提示,我想在禁用该按钮时删除工具提示。
Here is my Button
<button type="button" class="btn btn-default"
personinsuranceid="{{row.entity.PersonInsuranceId}}"
ng-disabled="row.entity.Sequence != 1"
ng-click="$event.stopPropagation(); grid.appScope.AddPlantoCase(row.entity, 1)"
data-toggle="tooltip" title="Add as Primary to case">
1
</button>
请建议我一种删除工具提示的方法。
最佳答案
工具提示直接从使用操作系统设置的浏览器呈现。因此,使用按钮很难隐藏工具提示。
您可以使用带 ng-click 的 span 来处理调用,并使用 ng-class 来设置样式,而不是按钮。不要忘记检查您的 AddPlantoCase() 是否处于禁用状态,当它为真时什么都不做。
<span class="btn btn-default"
personinsuranceid="{{row.entity.PersonInsuranceId}}"
ng-click="grid.appScope.AddPlantoCase(row.entity, 1)"
ng-class="{disabled: row.entity.Sequence != 1}"
data-toggle="tooltip" title="Add as Primary to case">
1
<span>
/* CSS */
.disabled {
cursor: not-allowed;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
}
关于angularjs - 如何从禁用按钮中删除工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39095048/