Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.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
Html 如何使ui网格响应AngularJS中的高度_Html_Angularjs_Ui Grid - Fatal编程技术网

Html 如何使ui网格响应AngularJS中的高度

Html 如何使ui网格响应AngularJS中的高度,html,angularjs,ui-grid,Html,Angularjs,Ui Grid,我试图使我的网格响应,而不是移动,只是当用户调整窗口大小。 我正在使用ui网格自动调整大小,但它只调整宽度大小。高度不变 我试图添加一个指令 app.directive('resize', ['$window', function ($window) { return function (scope, element, attr) { var w = angular.element($window); scope.$watch(function () { ret

我试图使我的网格响应,而不是移动,只是当用户调整窗口大小。 我正在使用ui网格自动调整大小,但它只调整宽度大小。高度不变

我试图添加一个指令

app.directive('resize', ['$window', function ($window) {
return function (scope, element, attr) {

    var w = angular.element($window);
    scope.$watch(function () {
        return {
            'h': window.innerHeight,
            'w': window.innerWidth
        };
    }, function (newValue, oldValue) {
        scope.windowHeight = newValue.h;
        scope.windowWidth = newValue.w;
        debugger;
        scope.resizeWithOffset = function (offsetH) {
            scope.$eval(attr.notifier);
            return {
                'height': (newValue.h - offsetH) + 'px'
            };
        };

    }, true);

    w.bind('resize', function () {
        scope.$apply();
    });
}
}])
还有我的网格

  <div ui-grid="gridOptions" class="grid testTrans nopadding" ui-grid-selection ui-grid-auto-resize ui-grid-exporter ui-grid-move-columns ng-style="resizeWithOffset(pageOffSetY)" rezise>
                <div class="well grid-loading" ng-show="grid.rows.length == 0">
                    <i class="fa fa-spin fa-spinner"></i>
                    <strong>Data Loading...</strong>
                </div>

            </div>

数据加载…

我在代码中加入了一些调试器,但它从未通过。

对我有效的还有:

 <div  layout="row" flex style="margin: 0;position: relative;" 
        ng-style="resizeWithOffset(323)" resize >

                                    <div  ui-grid="gridOptions" 
                                          class="wm-dashboard-grid"
                                          style="position: absolute;
                                                    top: 0;
                                                    left: 0;
                                                    right: 0;
                                                    bottom: 0;"
                                          ng-style="resizeWithOffset(325)" resize
                                          ui-grid-auto-resize
                                          ui-grid-pagination
                                          ui-grid-selection
                                          ui-grid-resize-columns>
                                    </div>

                                </div>


只需调整屏幕大小

您想调整
ui网格高度,即垂直滚动还是单元格高度?