gpt4 book ai didi

angular-ui-grid - ui 网格过滤器切换不起作用, "type was not recognised"?

转载 作者:行者123 更新时间:2023-12-01 02:11:05 28 4
gpt4 key购买 nike

我有一个用于切换 $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 .这解决了我的问题。此外,我正在使用版本 1.2.28的角度。

关于angular-ui-grid - ui 网格过滤器切换不起作用, "type was not recognised"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29301569/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com