Javascript 如何在表中使用angularjs搜索筛选器
我正在表格中使用分页。库在其指令中使用Javascript 如何在表中使用angularjs搜索筛选器,javascript,angularjs,Javascript,Angularjs,我正在表格中使用分页。库在其指令中使用ng repeat,并从我传递给它的数组中创建自己的数组 我无法使用angularjs提供的搜索过滤器,因为库使用自己的数组(从我的数组)执行ng repeat 在使用此库时,是否有任何方法可以使用搜索筛选器 这就是表的外观(库所期望的方式) Sl号 厂商名称 电子邮件ID {{calculateIndex($index)} 我在表格中不使用ng repeat。图书馆做这件事 上面的列表中的是如何获取我的数组并使用它创建自己的数组,该数组只包含显示的行
ng repeat
,并从我传递给它的数组中创建自己的数组
我无法使用angularjs提供的搜索过滤器,因为库使用自己的数组(从我的数组)执行ng repeat
在使用此库时,是否有任何方法可以使用搜索筛选器
这就是表
的外观(库所期望的方式)
Sl号
厂商名称
电子邮件ID
{{calculateIndex($index)}
我在表格中不使用ng repeat
。图书馆做这件事
上面的列表中的
是如何获取我的数组并使用它创建自己的数组,该数组只包含显示的行
如何使用angularjs搜索过滤器
Edit我更改了库中的html,并在libraryArray中添加了一个
项| filter:searchText
,它可以工作,但由于库的数组只包含当前显示的行,因此它只搜索和显示当前页面(分页)中的行。使用ng模块:$filter
你会发现这很有用
(单击“交互式示例”)一个伟大的分页、筛选和排序库,所有这些都可以非常快速、轻松地实现,它是ngTable,下面是一个链接:
嘿,谢谢。我应该看到的。我会接受你的回答。但我在一页中有许多表格。我正在尝试编写一个通用函数,该函数接受原始数组和过滤数组。我将过滤后的数组分配给参数本身,而不是分配给
$scope
数组。它不起作用。你能告诉我如何使用常用功能吗。。我这样做了,它成功了。$scope[filteredList]=$filter(“filter”)(originalList,$scope.searchText)代码>在html中传递数组名称时
<table at-table at-list="myarray" at-paginated at-config="tableConfig">
<thead>
<tr>
<th class="text-center" at-attribute="index">Sl No</th>
<th class="text-center" at-attribute="vendor_name">Vendor Name</th>
<th class="text-center" at-attribute="email_id">EmailId</th>
<tr>
</thead>
<tbody>
<tr>
<td class="text-center" class="text-center" at-attribute="index">{{calculateIndex($index)}}</td>
<td class="text-center" at-sortable at-implicit at-attribute="vendor_name"></td>
<td class="text-center" at-sortable at-implicit at-attribute="email_id"></td>
</tr>
</tbody>
</table>
<div>
<at-pagination at-config="tableConfig" at-list="myarray"></at-pagination>
</div>