Skip to content

Commit

Permalink
Change frozenColumns approach in demos
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo authored and Saulis committed Oct 27, 2016
1 parent 8d9e4b7 commit 0b16494
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demo/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
white-space: nowrap;
}
</style>
<vaadin-grid id="component" data-source="[[dataSource]]" size="10000000" frozen-columns="1" on-item-changed="_itemChanged" multi-selection>
<vaadin-grid id="component" data-source="[[dataSource]]" size="10000000" on-item-changed="_itemChanged" multi-selection>

<template is="row-details">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
Expand All @@ -43,7 +43,7 @@
<paper-input value="{{item.name}}"></paper-input>
</template>

<vaadin-grid-column width="100px">
<vaadin-grid-column width="100px" frozen>
<template>
<span class="elItem">[[item.name]]</span>
</template>
Expand Down
13 changes: 12 additions & 1 deletion demo/dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ <h1 main-title>Vaadin Grid Scroller</h1>
</app-toolbar>
</app-header>

<vaadin-grid id="component" size="[[size]]" frozen-columns="[[frozenColumns]]" row-count="2">
<vaadin-grid id="component" size="[[size]]" row-count="2">
<vaadin-grid-column width="[[width]]px">
<template>
<div class="elItem" style$="[[_getStyle(index, height)]]">#[[index]]</div>
Expand Down Expand Up @@ -282,6 +282,17 @@ <h1 main-title>Vaadin Grid Scroller</h1>
}
},

observers: [
'_onFrozenChanged(frozenColumns)'
],

_onFrozenChanged: function(f) {
this.$.component.columns[this.$.component.columns.length - 1]
.forEach(function(c, i) {
c.toggleAttribute('frozen', i < f);
})
},

iconForItem: function(item) {
return item ? (item.integer < 50 ? 'star-border' : 'star') : '';
},
Expand Down
2 changes: 1 addition & 1 deletion demo/grp.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
</style>
<vaadin-grid id="component" data-source="[[dataSource]]" size="20" multi-selection>
<vaadin-grid-column class="C0" width="30px" flex="0">
<vaadin-grid-column class="C0" width="30px" flex="0" frozen>
<template is="header" class="c0">TC0</template>
<template>[[index]]</template>
</vaadin-grid-column>
Expand Down

0 comments on commit 0b16494

Please sign in to comment.