I think you are right in that going through the DOM is the only way, rather than through the cell during instantiation. It makes sense if you think about it too, considering that within the Cell renderer code that I write, the element has yet to even attach to the DOM. So, the solution (I think) is to wait until the CellList rows are rendered and attached to the DOM, and then find the element either by Id or some other means using the DOM. In my case, I give the Id a specific name in the cell renderer code, and then later use getElementById to find the Element. Thanks for the reply.
On Friday, November 4, 2016 at 6:56:05 AM UTC-7, vinnyjames wrote:
-- On Friday, November 4, 2016 at 6:56:05 AM UTC-7, vinnyjames wrote:
I've done something similar by searching up the DOM tree:public static Element getFirstParentWithNodeName(Element e, String nodeName) { Element parent = e.getParentElement();if(parent == null) {// end of the line} else {String pname = parent.getNodeName();if(nodeName.equalsIgnoreCase(pname)) { return parent;} else {return getFirstParentWithNodeName(parent, nodeName); }}return null;}
On Thursday, November 3, 2016 at 3:35:51 PM UTC-7, Paul Mazzuca wrote:Is it possible to obtain a reference to a divElement inside a GWT custom cell?Many Javascript libraries (Google JS Map API, Google Charts API, etc) often require a div element to be passed to the javascript in order to render, for example, a map or chart. Basically, I am trying to create a cell list of charts or maps, but cannot seem to figure out how to get a reference to the divElement container within each cell.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment