繁体   English   中英

过滤 Angular-ui 滚动

[英]Filtering Angular-ui Scroll

我正在尝试在一个简单的网格上实现无限类型滚动。 html是这样的:

<div class="text-center" style="background-color:#eee;">
    <H2 style="margin-top:0px;">Customer List</H2>
    <hr />
    Search: <input ng-model="customerVm.search" /> <br /> <br />

    <table class="table table-hover" ui-scroll-viewport style="height:500px;">
        <tbody>
        <tr ui-scroll="customer in customerVm.datasource" ng-model="customerVm.gridResult" "buffer-size="10">
                <td>
        </tbody>
    </table>
</div>

我想根据搜索框模型过滤网格中的内容,看起来很简单。 我通常只会将以下内容与 ng-repeat 一起使用

 <tr ng-repeat="customer in customerVm.datasource | filter:customerVm.search" ng-model="customerVm.gridResult" "buffer-size="10">
                <td>{{customer.customername}}</td>
            </tr>

但是,使用“ui-scroll”而不是 ng-repeat 时出现错误

Expected uiScroll in form of '_item_ in _datasource_' but got 'customer in customerVm.datasource | filter:customerVm.search'

我是否缺少有关如何使用 Angular-ui 滚动过滤数据的信息? 我在滚动库中看到导致问题的行,如果有其他任何事情则会引发错误

item in datasource

这让我认为在 Angular-ui 滚动中不可能进行过滤。 大家有什么想法吗?

不幸的是,正如错误所暗示的那样,这种方式尚无法进行过滤。 请参阅自述文件中的“参数”。 您可以在数据源“get”函数中实现自己的过滤器。 另请参阅官方示例

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM