材料设计寻找ag-grid

时间:2016-09-03 10:41:29

标签: ag-grid

如何为aggrid使用材质设计功能?在我的angular2应用程序中,我使用了ag-grid并将类名称称为ag-material,并将行高设置为48。但材料设计看起来并不适用于我的网格。我应该在我的索引中包含任何CSS文件,还是从aggrid包中获取? 这就是我将ag-material类应用于网格并在末尾覆盖行高的方法。

            <ag-grid-ng2  style="width: 100%; height: 100%;"
                     class="ag-material"
                     [gridOptions]="gridOptions"
                     [columnDefs]="columnDefs"
                     [rowData]="rowData"
                     rowSelection="single"
                     (selectionChanged)="onSelectionChanged()"
                     rowHeight="48">
        </ag-grid-ng2>

有人可以帮助我让材料设计找到aggrid吗?

1 个答案:

答案 0 :(得分:1)

angular 2 implementation上的指南说

  

您需要直接在html页面中包含ag-Grid的CSS,或者在捆绑时创建捆绑包的一部分。

然后它演示了包含所需的样式表:

<link href="node_modules/ag-grid/styles/ag-grid.css" rel="stylesheet" />
<link href="node_modules/ag-grid/styles/theme-fresh.css" rel="stylesheet" />

查看github repo,它显示了您需要包含的材质主题的单独样式表:

<link href="node_modules/ag-grid/styles/theme-material.css" rel="stylesheet" />
相关问题