【发布时间】:2018-01-16 03:27:39
【问题描述】:
我有一张如下图所示的表格
╔═════╦═════╦═════╦═════╗
║ A ║ B ║ C ║ D ║
╠═════╬═════╬═════╬═════╣
║ abc ║ pqr ║ XYZ ║ RSY ║
╚═════╩═════╩═════╩═════╝
现在,在此表中,我将 content-editable 或 HTML5 用于 column B。
有了这个,我可以编辑column B 的内容
.
现在,在这里,当我编辑此内容时,有什么方法可以让我知道已编辑了哪一行以及列 An 的值,假设我已编辑
pqr -> aaa
那么应该是这样的
╔═════╦═════╦═════╦═════╗
║ A ║ B ║ C ║ D ║
╠═════╬═════╬═════╬═════╣
║ abc ║ aaa ║ XYZ ║ RSY ║
╚═════╩═════╩═════╩═════╝
现在我正在使用jquery 来了解表格的内容。
<div class="table-responsive">
<table class="table table-striped table-bordered report-table" contextmenu-container="meta.contextmenu" fixed-header>
<thead class="text-center text-info">
<th class="text-center">Annotation</th>
<th class="text-center">Field</th>
<th class="text-center">Message</th>
<th class="text-center">Score</th>
</thead>
<tr ng-repeat="report in reports.data">
<td class="text-center">{{ report.attributes.annotation }}</td>
<td class="td-report-field" contentEditable contextmenu-item="report" context-menu="menuOptions">{{ report.attributes.field }}</td>
<td>
<input type="checkbox" ng-if="report.attributes.message && showcheckbox" ng-bind="report.attributes.message" ng-click="getcheckedData(report.attributes.message)">
<span ng-if="report.attributes.message" ng-model="report.attributes.message">
{{ report.attributes.message }}
</span>
<span ng-if="!report.attributes.message">{{ report.attributes.message }}</span>
</td>
<td class="text-center">{{ report.attributes.score }}</td>
</tr>
</table>
</div>
【问题讨论】:
标签: javascript jquery angularjs angularjs-directive contenteditable