Closed hotforfeature closed 7 years ago
@Saulis ... we're keen to prototype vaadin-grid (v3 supporting polymer 2) in an angular4 context. Is this suggested fix alot of work to get in? Thanks.
@hotforfeature @Analect I've made a POC branch here column-template-observer
which should work at least on a concept level. Could you guys try it out if you get any results when running on Angular?
I'll test out that branch and see how it works in Angular 4.
I tested and so far it looks like it's working! There's one change that needs to be made though:
https://github.com/vaadin/vaadin-grid/blob/master/vaadin-grid-column.html#L97
_prepareTemplatizer()
can get called multiple times, and the template already has a templatizer. We should change this to
if (template && !template.templatizer) {
to ensure the templatizer doesn't get replaced.
@Saulis ... posting @hotforfeature preliminary demo here (hope that's OK) based on those changes you had implemented on the column-template-observer
branch.
Seems I forgot to add. Sorry. https://github.com/hotforfeature/origami/tree/vaadin/demo
@Saulis ... do you think you might be able to roll in your changes in the column-template-observer
branch with the small fix above? As per @hotforfeature comment here, that appears all that's needed to get vaadin-grid compatible with origami. Thanks.
@hotforfeature @Analect I've added the !template.templatizer
check along with some tests to the column-template-observer
branch (force pushed, so remember to run bower cache clean
) – could you guys verify this version works better for you and I'll push a pull request for it. Thanks!
@Saulis works perfectly!
@Saulis ... do you think your fix on column-template-observer
could get included in your next release? Thanks.
@Analect need to do some additional fixes to make it releasable, but I'll try to get a PR up asap.
Master build is not green, so moving this to the backlog until we spend some time to fix master.
@manolo @Saulis ... is https://github.com/vaadin/vaadin-grid/pull/918 any close to being merged? Thanks.
Discussed with @Saulis. The grid won't work with Angular 2 and other libraries where elements are created and attached programatically.
Specifically, the column templates in Angular 2 are first created, then attached to
<vaadin-grid-column>
before child elements are attached to the<template>
.Adding some observers for when templates or their content changes will resolve any issues with programmatically creating and attaching a grid and its children. Alternatively, we could expose an API to inform the grid that its templates or columns have changed so that it knows to re-stamp them.
Relates to https://github.com/hotforfeature/origami/issues/18 for Angular 4/Polymer 2 support.