Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/477.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS:ui网格调整列的大小似乎不起作用。导致标题行增长_Javascript_Css_Angularjs_Angular Ui Grid - Fatal编程技术网

Javascript AngularJS:ui网格调整列的大小似乎不起作用。导致标题行增长

Javascript AngularJS:ui网格调整列的大小似乎不起作用。导致标题行增长,javascript,css,angularjs,angular-ui-grid,Javascript,Css,Angularjs,Angular Ui Grid,我使用角度ui网格。我已经在控制器中包含了如下适当的注入 controller.js: 我的HTML: 所有模块均可用且可访问。但在呈现表时,不会进行调整大小 尝试在$scope.on内渲染网格;我不太明白。我是个新手。我该怎么做?您需要包装$scope.walltimeGrid={在$scope.on中;我不确定这是否会起作用,使用datatablesjsNo对我起作用,但不起作用。作用域似乎设置正确,这就是加载数据和其他功能的原因。问题是网格中的垂直滚动条可见且未启用。我想这会导致标题行扩展

我使用角度ui网格。我已经在控制器中包含了如下适当的注入

controller.js:

我的HTML:

所有模块均可用且可访问。但在呈现表时,不会进行调整大小


尝试在$scope.on内渲染网格;我不太明白。我是个新手。我该怎么做?您需要包装$scope.walltimeGrid={在$scope.on中;我不确定这是否会起作用,使用datatablesjsNo对我起作用,但不起作用。作用域似乎设置正确,这就是加载数据和其他功能的原因。问题是网格中的垂直滚动条可见且未启用。我想这会导致标题行扩展到ove所有表大小。
    'use strict';
    //'ui.grid' is dependency injected into angular
    var bbApp = angular.module('bbApp', ['ui.grid', 'ui.grid.selection',    'ui.grid.resizeColumns']);

    // Below is the code to allow cross domain request from web server through angular.js
    bbApp.config(['$httpProvider', function($httpProvider, $routeProvider, $locationProvider) {
    $httpProvider.defaults.useXDomain = true;
    delete $httpProvider.defaults.headers.common['X-Requested-With'];
    }
    ]);

    bbApp.controller('BBCtrl', function ($scope, $http) {
    $scope.list = function() {
      var url = '/members'; // URL where the Node.js server is running 
    queryWalltimeList();

    // Accessing the Angular $http Service to get data via REST Communication from Node Server
    function queryWalltimeList() {
        $http.get(url).success(function(data) {
        $scope.walltimeList = data;
        });
    }

    $scope.walltimeGrid = { 
    data: 'walltimeList',
    enableRowHeaderSelection: false, 
    enableFiltering: true,
    multiSelect: false,
    enableGridMenu: true,
    columnDefs: [
      {field: 'name', displayName: 'Design', width: "65%"},
      {field: 'walltime', displayName: 'Memory', width: "35%"}
    ]
    };

    $scope.walltimeGrid.onRegisterApi = function(gridApi){
      //set gridApi on scope
        $scope.gridApi = gridApi;    
    };
    };
    $scope.list();
});
<section>
    <div ui-grid="walltimeGrid" ui-grid-selection ui-grid-resize-columns class="bb-grid">
</section>
.bb-grid {
  width: 300;
  height: 200;
  overflow-y: auto;
}