小编Vas*_*ili的帖子

Angular Grid ag-grid columnDefs动态更改

我有columnDefs动态变化的问题.这是我的gridOptions:

$scope.gridOptions = {
        columnDefs: [],
        enableFilter: true,
        rowData: null,
        rowSelection: 'multiple',
        rowDeselection: true
    };
Run Code Online (Sandbox Code Playgroud)

当我从服务器检索数据时:

$scope.customColumns = [];

$http.post('/Home/GetProducts', { tableName: 'TABLE_PRODUCT' }).success(function (data) {
    angular.forEach(data.Columns, function (c) {
        $scope.customColumns.push(
            {
                headerName: c.Name,
                field: c.Value,
                width: c.Width
            }
        );
    });

    $scope.gridOptions.columnDefs = $scope.customColumns;

    $scope.gridOptions.rowData = data.Products;
    $scope.gridOptions.api.onNewRows();
}).error(function () {

});
Run Code Online (Sandbox Code Playgroud)

注意:这里c是来自服务器的列对象.

当动态生成列并将其分配给$ scope.gridOptions.columnDefs时,会出现空白网格,但$scope.customColumns数组中填充了右侧生成的列对象.请帮帮我是这个错误还是我做错了什么?

angularjs ag-grid

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

如何从Chrome浏览器中打开的PDF中复制文本

我在Chrome的新标签中打开了PDF,想要复制文字.有没有解决办法呢?

pdf text google-chrome copy-paste

14
推荐指数
1
解决办法
9687
查看次数

标签 统计

ag-grid ×1

angularjs ×1

copy-paste ×1

google-chrome ×1

pdf ×1

text ×1