我试图制作一个具有表格的网页,并且用户必须能够点击已过滤的行或未经过滤的行,并弹出一个模式显示有关所选行的更多信息。从HTML表格行中获取值并将它们传递给模式
这里是主代码(包括表)
<body ng-app="mainApp">
<h1>Issues Repository</h1>
<div class="container-1">
<span class="icon"><i class="fa fa-search"></i></span>
<input type="search" id="search" ng-model="searchBox" placeholder="Buscar..." />
</div>
<div>
</div>
<div id="divBuscador" ng-controller="issues">
<table class="table table-striped" id="tableList" cellspacing="0" border=1>
<tr>
<th>OpCo</th>
<th>Tecnologia</th>
<th>Version</th>
<th>Titulo del Issue</th>
<th>Estado</th>
</tr>
<tr class='clickable-row' data-target="#contentModal" style="cursor:pointer" id="issueList" ng-repeat="document in documents | filter:searchBox" ng-click="openModal(documents)">
<td id="opCo_Val">{{ document.opCo}}</td>
<td id="tec_Val">{{ document.Tecnology }}</td>
<td >{{ document.Version }}</td>
<td >{{ document.Issue }}</td>
<td >{{ document.Status }}</td>
</tr>
</table>
</div>
这是链接到功能上的点击:
jQuery(document).ready(function($) {
$(".clickable-row").click(function() {
$('#contentModal').modal('show');
});
});
这是控制器:
app.controller('issues', ['$scope', function($scope, $modal){
$scope.documents = fileX.records;
}]);
我怎样才能将变量传递给模态,如{{document.Version}}或{{document.Issue}}
请解释一切,我新来角。
@PankajParkar请解释一下你自己......我不知道如何应用ng-click – Marcelo
你有没有尝试使用类似ui-bootstrap的库它具有惊人的模态解释如何传递数据。 –