使用搜索栏过滤列中有重复条目的区分大小写的数据,并返回特定的行AngularJS
Filter a case-sensitive data with duplicate entry in a column using search bar and return that particular row AngularJS
我的解决方案:AngularJS-搜索表-筛选器表格,td{边框:1px纯灰色;边界塌陷:塌陷;填充:5px;}
<body>
<div ng-app="myApp" ng-controller="namesCtrl"/>
<p>Filtering input:</p>
<p><input type="text" data-ng-model="search.City"></p>
<table>
<tr data-ng-repeat="x in names | filter: search: strict ">
<td> {{ x.Name }}</td>
<td>{{ x.City }} </td>
<td> {{ x.Country }}</td>
</tr>
</table>
<p>{{ City | lowercase }}</p>
<script>
var app = angular.module('myApp', []);
app.controller('namesCtrl', function($scope, $http) {
$http.get("names.js")
.success(function (response) {$scope.names = response.records;});
});
</script>
</body>
</html>
The above code displays the data from the table from the column "City". But I have a duplicate like,"Sao" and "sao". When the user searches for "Sao" the returned value should be the row of data which contains "Sao" as the city.
在搜索之前单击此处查看解决方案
点击此处查看过滤后的
看看其他帖子提供的答案。
https://stackoverflow.com/a/24798741/6654503
您还可以根据上述答案更新比较器功能(如果需要),以满足您的需求。
相关文章:
- 用程序搜索JQuery数据表中的文本
- 要求输入在数据列表中
- 正在将数据主题添加到所有项目
- 函数参数中的数据与指定变量之间的任何性能差异
- 在VanillaJS中模拟模型双向数据绑定
- CSS-如何定位内容数据标题
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 无法在数据endVal中设置值=“”;{{ucount}}”;使用Angular JS的CountUp
- 序列化数据属性中对象的最可靠方法
- 如何将JSON数据导入我的ejs模板
- 不显示带有本地json文件数据的谷歌地图脚本
- 如何将json数据显示为html
- 画布数据到图像
- 使用jquery将mysql数据获取到新的表行中
- 数据属性中区分大小写
- 使用 javascript 从 Parse 中搜索不区分大小写的数据
- 在引导程序表数据中进行不区分大小写的搜索
- 角2中的破折号大小写(Kebab大小写)数据绑定
- 使用搜索栏过滤列中有重复条目的区分大小写的数据,并返回特定的行AngularJS
- 角度数据绑定 - 与 JavaScript 对象的绑定应该不区分大小写