I use v-grid component with Polymer. I try add custom buttons in one of columns. The buttons render correctly, but they don’t capture on-click event. I didn’t something wrong or it is a bug?
The problem is most likely the fact that the on-click handler is lost when we copy the light DOM HTML content into the actual final render tree. The grid is not really a Polymer element in the sense that was built before Polymer using GWT, and we just have a wrapper around it using Polymer, so some of the things you expect to work with Polymer could work unexpectedly.
Thank you so much. I am wondering what do you recommand to identify which row I clicked on by using a custom button? For example, in this cas, I which to remove the item when the button is clicked.
Oh, right, sorry. I was supposed to add that info to the workaround as well
Basically, you can use cell.row.index to access the row index (added to the workaround). There’s a known issue about using that variable, as it is a proxy object, so the value always reflects the last index in the visible viewport. You need to store the value in another variable to access the correct value later: https://github.com/vaadin/components/issues/21
The bug above is fixed after I updated to beta 6. Thank you.
However, the renderer function still does not work. I render nothing in the cell. It seems that cell.element.appendChild(button) does not work. Whatever I append to, it turn out blank.