Nested ng-Grids?

拥有回忆 提交于 2019-12-10 17:32:07

问题


Can we make a nested ng-grid. something like this, is it possible. here's plunker:

http://plnkr.co/edit/hYuFfxLR38LA0clIkF48?p=preview

I have also tried doing this using , templateUrl.

any suggestions, modifications to plunker or links ?


回答1:


Yep, that might be working, although it doesn't make much sense.

First of all you have to supply some data to the parent grid so that at least one row is rendered.

Then you have to tell the parent grid to us another rowHeight than the default 30px.

Don't apply the grids class to the celltemplate.

    $scope.gridOptions = {
        data: 'facdata',
        rowHeight: '90',
        columnDefs: [{
          field: 'examname',
          displayName: 'Exam Name',
          cellTemplate: '<div  ng-grid="gridOptions1" ng-bind="row.getProperty(col.field)"></div>'
        }]
    };

Here is a Plunker

As you can see the there are two rows with a vaguely guessed height and two identical child grids with scrollbars.

What I don't understand is how you want to have different data for the childgrids.

Please explain more what exactly you want to achieve.



来源:https://stackoverflow.com/questions/24008491/nested-ng-grids

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!