0
这就是我正在做的。 我所说的REST API返回响应以这种格式创建多个表时智能表搜索不起作用
“元语言”:{ “1”:{ “ID”:1, “名称”: “阿布哈兹” }, “2”: { “ID”:2, “名”: “远方” }} , “制造商”:{ “-1”:{ “ID”:-1, “名”: “所有” }, “1”:{ “id”:1, “name”:“RIM” }, “2”:{ “ID”:2, “名”: “HP” }}
这基本上是一个地图字符串和地图。 我现在必须创建n个表,其中n是原始地图中的键的数量,并且在每个表内必须显示将是内部地图的值的数据(“id”:2, “name”:“HP “)
我使它工作,但搜索不起作用。 这是我的示例代码
<div ng-repeat="(key,value) in metadataDetails">
<table st-table="metadataCollection" st-safe-src="metadataDetails" class="table table-striped">
<thead>
<tr class="style_tr">
<th st-sort="name">name</th>
<th st-sort="name">name</th>
<th st-sort="description">description</th>
<th st-sort="countryName">countryName</th>
<th st-sort="carrierName">carrierName</th>
</tr>
<tr class="textSearchTr">
<th colspan="4" class="textSearchTr">
<input class="freshblue" placeholder="Enter value to search/filter" type="text" ng-model="searchParam.search" />
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in getValueMap(key)" ng-show="showRow">
<td>{{row.id}}</td>
<td>{{row.name}}</td>
<td>{{row.description}}</td>
</tr>
</tbody>
</table>
</div>
而我的JS文件
AuditMetadataService.get({}, function(data) {
$scope.numRecord = data.length;
$scope.metadataDetails = data;
$scope.metadataCollection = [].concat($scope.metadataDetails);
console.log("Return value :");
console.log($scope.metadataDetails);
});
$scope.getValueMap = function(key) {
console.log(key);
return $scope.metadataDetails[key];
};
可能有人请帮助?
谢谢,这解决了我的问题。 – Pratik