none
Angular Js using mvc RRS feed

  • General discussion

  • Hi , 

    This is sai kumar

    can any body help me to perform column wise filtering in angularjs using ng grid.

    By default ng grid provides global search for filtering.

    But my requriement is how to do filters for column wise.[not row wise].

    Example: Code

                   

                  $scope.filterOptions = {
                    filterText: $scope.miinput,
                    useExternalFilter: true
                };

     $scope.pagingOptions = {
                    pageSize: 5,
                    currentPage: 1

                };

                $scope.gridOptions = {
                    data: 'groupList',
                    multiSelect: false,
                    //enableColumnResize: true,
                    totalServerItems: 'totalServerItems',
                    pagingOptions: $scope.pagingOptions,
                    filterOptions: $scope.filterOptions,
                    columnDefs: 'myColumns',
                    rowHeight: 50,
                    headerRowHeight: 50,
                    enablePaging: true,
                    showFilter: true,
                    showFooter: true,

                };

                $scope.myColumns = [

                      { field: 'ID', displayName: 'ID', width: 166.67, visible: true}, /
                      { field: 'Name', displayName: 'Name', width: 166.67},
                      { field: 'Designation', displayName: 'Designation', width: 166.67},
                      { field: 'Mobile', displayName: 'Mobile', width: 166.67},
                      { field: '', displayName: '', width: 166.67, cellTemplate: '<button ng-style="width:65%;" ng-click="GridOnRowSelect(row.entity)" class="btn btn-info">Edit</button>', enableSorting: false },
                      { field: '', displayName: '', width: 166.67, cellTemplate: '<button ng-style="width:65%;" ng-click="Delete(row.entity)" class="btn btn-danger">Delete</button>', enableSorting: false }
                ];

    Thanks in advance

    Monday, July 17, 2017 10:59 AM

All replies