相关疑难解决方法(0)

Angular UI Grid:如何为列过滤创建预先填充的下拉菜单

我正在寻找有关Angular UI Grid功能的一些帮助.具体来说,我正在探索过滤,虽然我能够在我的应用程序中使用自由格式文本字段成功实现排序,就像他们在其网站上 的示例中所做的那样,我希望找到一些帮助,找到一种方法来使用预先填充的排序某些列的下拉菜单.

澄清一下:通过预先填充,我的意思是我希望通过我的代码填充下拉列表.我很好,如果解决方案包含硬编码数据,但我最终的目标是让预填充包含被排序的列的唯一数据值集:)

我在(例如)Kendo UI(kendodropdownlist)中看到了这个功能,但我对该解决方案附带的价格标签不感兴趣.我想坚持上面提到(和链接)的Angular UI-grid.在StackOverflow上我发现了一个类似的问题,但不幸的是它似乎并没有太多牵引力.我希望通过对我正在寻找的内容给出更详细的解释,我会得到比我在那里找到的更完整的答案.

以下是我的控制器中的内容:

var simpleMessagingApp = angular.module('MainAppCtrl', [ 'ngAnimate',
                                                         'ngTouch', 'ui.grid' ]);

simpleMessagingApp.controller('CacheTableCtrl', [ '$scope', '$http',
                                                  'uiGridConstants', function($scope, $http, uiGridConstants) {
    $scope.columns = [ {
        field : 'trans_detail',
        displayName : 'Transaction'
    }, {
        field : 'cust_name',
        displayName : 'Customer'
    }, {
        field : 'quantity',
        displayName : 'Quantity',
        filters : [ {
            condition : uiGridConstants.filter.GREATER_THAN,
            placeholder : 'greater than' …
Run Code Online (Sandbox Code Playgroud)

angularjs drop-down-menu angular-ui-grid

19
推荐指数
2
解决办法
2万
查看次数