Reputation: 1932
I am using an Angular Material grid list to display around 500 - 1000 items. I am having some trouble styling it to my liking. Here is what the grid list looks like now:
<md-grid-list md-cols-xs="1" md-cols-sm="2" md-cols-md="4" md-cols-gt-md="6"
md-row-height="16:9"
md-gutter="12px" md-gutter-gt-sm="8px">
<md-grid-tile ng-repeat="orgOrder in vm.orgOrders | filter: query1"
style="background: #f5f5f5"
layout-align="center center"
ng-click="vm.addOrder(orgOrder)">
<div layout="column">
<div> {{orgOrder.orderNumber}}</div>
<!--<div> {{orgOrder.reqExFact | date : 'dd/MM/yyyy'}}</div>-->
</div>
</md-grid-tile>
</md-grid-list>
Here is what I would like to do:
Let me know if you need to see any more of my code.
here is a jsfiddle similar to my code:https://jsfiddle.net/rakshak/6tjgbb85/
I would like the grid titles(items) to fit the text in them and I would like to wrap a container around the entire grid list and have a overflow scroll bar instead of the entire window scrolling.
Upvotes: 4
Views: 3807
Reputation: 5176
Setting md-row-height like md-row-height="20px"
or md-row-height="30px"
seems to address the height issues nicely. Nesting the grid inside of a fixed height div defined something like this:
.tileContainer {display:block;
width:100%;
height:100px;}
will give you a scroll bar for the tiles.
I forked your plunker here: https://jsfiddle.net/uegLh6t4/
Upvotes: 1