首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在从服务器端过滤服务的ui-网格列中创建多选择筛选器?

如何在从服务器端过滤服务的ui-网格列中创建多选择筛选器?
EN

Stack Overflow用户
提问于 2017-08-10 09:19:43
回答 1查看 972关注 0票数 1

我在页面上有一个ui网格,启用了服务器端分页和服务器端过滤,目前它只有一个下拉列表,它显示了来自服务器的每页json中所有页面的可能值。

现在,我需要用户提供选项从下拉列表中选择多个值,就像multiselect下拉列表一样,然后按下服务,收集分页数据并刷新ui网格。

我遇到过许多解决方案,但没有人给我服务器端解决方案,所有解决方案都属于单个json源:

代码语言:javascript
复制
1. ui-grid - <http://ui-grid.info/docs/#/tutorial/306_custom_filters>
> I cannot use it as my options can be lengthier and also will be the grid look uneven and user experience will be bad

2. Using angular-dropdown-multiselect.js directive  - <http://plnkr.co/edit/MLT02DpcwoL0AK2QClow?p=preview>
> This looks fine but it is having the options hardcoded and no server interaction

3. Using custom multi select - <http://www.c-sharpcorner.com/article/how-to-create-a-custom-multi-select-filter-for-ui-grid-in-angularjs-1-x/>
> Only problem is this one is in Angular 2 or above and my application is Angular 1.4.0

请建议一些解决方案,以便我可以得到多选择,从服务器端的响应填充选项,当选择它与服务器交互,以获得ui网格的数据集。

EN

回答 1

Stack Overflow用户

发布于 2018-07-27 16:08:02

  1. 使用角下拉-Multiselect.js指令

您可以在showModal中重写multiSelectCtrl方法,以便从API中获取用于筛选的所有可用选项。

而且,在这个方法中,$scope.col.grid是可用的-您可以从那里获取'select‘值(grid.columnsi.filters.selectOptions)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45609462

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档