angular-ui-grid-ui网格过滤器切换不起作用,“类型未被识别”?

前端之家收集整理的这篇文章主要介绍了angular-ui-grid-ui网格过滤器切换不起作用,“类型未被识别”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个过滤器切换按钮,用于切换$scope.uiGridOptions.enableFiltering.

$scope.toggleFiltering= function () {
        $scope.uiGridOptions.enableFiltering = !$scope.uiGridOptions.enableFiltering;
        $scope.gridApi.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
    }

{{uiGridOptions.enableFiltering}}更改true和false,但我的网格中的过滤器不会隐藏/显示.

$scope.uiGridOptions = {
        enableFiltering:true,//default
        onRegisterApi: function (gridApi) {
            $scope.gridApi = gridApi;
        },columnDefs: [                
             {
                 field: 'name',name: 'Name'

             }]
  }

在控制台中,跟随错误显示.

Notified of a data change,but the type was not recognised,so no action taken,type was: undefined
(anonymous function)
d.service.q.logError
o.notifyDataChange
d.service.q.createBoundedWrapper
$scope.toggleFiltering
ib.functionCall
Dc.(anonymous function).compile.d.on.f
$get.l.$eval
$get.l.$apply
(anonymous function)
jQuery.event.dispatch
jQuery.event.add.elemData.handle

我希望有一个人可以帮助我.

解决方法

这发生在我身上,因为我使用的是最新的“官方”3.0.0-rc.20.尝试使用 github的ui-grid的不稳定版本.这解决了我的问题.而且,我正在使用Angular的1.2.28版本.

猜你在找的Angularjs相关文章