【发布时间】:2017-12-26 10:32:51
【问题描述】:
我对@987654322@ 完全陌生。我有一张桌子,就像 -
HTML
<table class="table table-striped" id="manageResumeTable">
<thead class="text-center text-info text-capitalize">
<th class="text-center col-xs-1">Sr.No.</th>
<th class="text-center col-xs-4">Document</th>
<th class="text-center col-xs-1">Score</th>
<th class="text-center col-xs-1">QuickScore</th>
<th class="text-center col-xs-5">Actions</th>
</thead>
<tr ng-repeat="file in processResumeFiles" ng-class="{'highlighter-row-Class' : file.id == 1}">
<td class="text-center col-xs-1">{{ file.temporaryId }}</td>
<td class="view-orphan uploadResumeTableCellOverFlow col-xs-4">
{{ file.attributes.name }}
</td>
<td class="text-center col-xs-1">{{file.totalScore}}</td>
<td class="text-center col-xs-1" ng-class= "{'highlighter-QuickScore' : file.attributes.areQuickScoreFieldsMissing}">{{file.attributes.quickScore}}</td>
<td class="text-center col-xs-5">
<button class="btn btn-labeled btn-info" title="Annotate Un-annotated Words" data-ng-click="getOrphans($index)">
<i class="fa fa-eye" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" ng-show="file.attributes.isUploadedDocument" title="Promote to Gold Standard" data-ng-click="markAsGoldStd(file.attributes.name)">
<i class="fa fa-share" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" title="Delete from Corpus" data-ng-click="deleteResume(file.attributes.name)">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
<button class="btn btn-labeled btn-info" title="Add to Tracker" ng-disabled="!file.attributes.isModelHtmlPresent || !isjdDeleted || !jdSelected"
data-ng-click="moveToJobDescription(file.attributes.name)">
<i class="fa fa-check-square" aria-hidden="true"></i>
</button>
</td>
</tr>
</table>
在这里,我使用的是ng-repeat。因此,数据来自 ajax 调用。
现在在这里,file.id == 1 来自 ajax 调用,这工作正常,我也有一个 scrollbar 现在我只想在 file.id == 1 时关注该行。现在我能够强调这一点,但无法集中注意力。那么任何人都可以帮助我吗?提前致谢。
【问题讨论】:
-
使用 ng-if 。来源:docs.angularjs.org/api/ng/directive/ngIf
-
你对“焦点”的理解是什么。你想让浏览器自动滚动到第一行吗?
-
是的,滚动条应该在该行
-
这里没有输入元素。焦点仅适用于输入元素。
标签: javascript jquery angularjs ajax