Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to elements 1.2.0 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Updated to elements 1.2.0 #1

wants to merge 1 commit into from

Conversation

rondinif
Copy link

@rondinif rondinif commented Nov 5, 2017

0.3.0-beta12 no more available on CDN cause 404: we have to fix with current working release of Elements; I realize that now we have to import vaadin-grid/vaadin-grid.html instead of vaadin-elements.html

proposed patch:

From 11bdf78864f4d74ba900f6a6da77085aa224ceaf Mon Sep 17 00:00:00 2001
From: Franco Rondini 
Date: Sun, 5 Nov 2017 17:51:47 +0100
Subject: [PATCH] Updated to elements 1.2.0

---
 src/main/webapp/view.jsp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/view.jsp b/src/main/webapp/view.jsp
index ffb5939..3912adb 100644
--- a/src/main/webapp/view.jsp
+++ b/src/main/webapp/view.jsp
@@ -20,8 +20,8 @@
 
 <portlet:defineObjects />
 
-<script src="https://cdn.vaadin.com/vaadin-elements/0.3.0-beta12/webcomponentsjs/webcomponents-lite.min.js"></script>
-<link href="https://cdn.vaadin.com/vaadin-elements/0.3.0-beta12/vaadin-elements/vaadin-elements.html" rel="import">
+<script src="https://cdn.vaadin.com/vaadin-elements/1.2.0/webcomponentsjs/webcomponents-lite.min.js"></script>
+<link href="https://cdn.vaadin.com/vaadin-elements/1.2.0/vaadin-grid/vaadin-grid.html" rel="import">
 
 <vaadin-grid selection-mode="multi">
     <table>
-- 
2.13.5 (Apple Git-94)

@marcushellberg
Copy link
Owner

Hey, thanks for the PR! Had completely forgotten about this repo. Just changing the import versions won't be enough, though. The API changed between 1.x and 2.x. It is now using <vaadin-grid-column> tags for defining the columns, see https://vaadin.com/elements/vaadin-grid/html-examples/grid-basic-demos

It would be awesome if you have time to fix that, otherwise I'll look at it when I get a chance (but that may be in several days/weeks)

@rondinif
Copy link
Author

rondinif commented Nov 14, 2017

patching with 1.2.0 works "as is"; just tested with liferay-portal-6.2-ce-ga6/tomcat-7.0.62

I think it would still be useful to fix it for those coming from the link to the present repo included in
https://web.liferay.com/it/web/mhellber/blog/-/blogs/powerful-grid-component-for-restful-data-sources so them can run the project described in the blog.

I'm trying the change with "latest" and including vaadin-grid-column but it's requiring other changes maybe to the PagedDataSource since something go wrong in:

vaadin-grid-array-data-provider-behavior.html:32 Uncaught TypeError: (this.items || []).slice is not a function
    at HTMLElement._arrayDataProvider (vaadin-grid-array-data-provider-behavior.html:32) {snip] at 
    at HTMLElement._itemsChanged (vaadin-grid-array-data-provider-behavior.html:27)

Eventually for the change to latest I might open a new branch and a new PR in the future when I can better figure out how to adapt it to the new APIs for PagedDataSource in this scenario.

@marcushellberg
Copy link
Owner

Yeah. The API changed quite significantly between grid 1.x and 2. I'll need to update it at some point. Thanks for the pr!

@rondinif
Copy link
Author

Hi @marcushellberg ,
I'm moving towards the end of migration to latest API , still I need better understand how to apply sorting (still playing with vaadin-grid-sorter ) but the most serious problem for me is to understand custom column renderer in API 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants