我在页面上有一个ui网格,启用了服务器端分页和服务器端过滤,目前它只有一个下拉列表,它显示了来自服务器的每页json中所有页面的可能值。
现在,我需要用户提供选项从下拉列表中选择多个值,就像multiselect下拉列表一样,然后按下服务,收集分页数据并刷新ui网格。
我遇到过许多解决方案,但没有人给我服务器端解决方案,所有解决方案都属于单个json源:
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网格的数据集。
发布于 2018-07-27 16:08:02
您可以在showModal中重写multiSelectCtrl方法,以便从API中获取用于筛选的所有可用选项。
而且,在这个方法中,$scope.col.grid是可用的-您可以从那里获取'select‘值(grid.columnsi.filters.selectOptions)。
https://stackoverflow.com/questions/45609462
复制相似问题