Comments (4)
As a workaround, you need to store the cell.row.index
to a variable outside the event listener function and use the stored value.
from vaadin-grid.
I'm also getting some odd side effects even though my cell.row.index has been stored outside the event listener function. Each time I click on my menu button, the icons duplicate.
Of the three rows I have right now, the first row gets 3 after the first click while second and third row gets 2 after the first click...
this.$.grid.columns[9].renderer=function(cell){
cell.element.innterHTML = "";
var button = document.createElement("paper-icon-button");
button.setAttribute("icon","menu");
button.addEventListener("click",function(){
console.log("detecting click!");
});
cell.element.appendChild(button);
cell.row.index;
}
Do you have any idea why that might be happening? This code is the only javascript in my file at the moment
from vaadin-grid.
Hi @erinhong17,
There's a small typo in your example code that causes this:
innterHTML
should be innerHTML
After fixing this, the code seems to work as expected
from vaadin-grid.
Wontfix, the workaround should be sufficient.
from vaadin-grid.
Related Issues (20)
- TypeScript generics to allow declaring GridItem type HOT 1
- vaadin grid current row highlight issue HOT 1
- TreeGrid regression since 14.4.3 HOT 9
- Ellipses in selection column HOT 4
- 18.0.3 breaks grid in grid details HOT 1
- setItemDetailsRenderer in Vaadin 14.4.5 produce (TypeError) : $0.$connector HOT 1
- Clearing grid filtering is not working HOT 2
- Scrolling in a grid on iOS (Safari, Chrome) impossible HOT 6
- Grid.getDataProvider().refreshAll() length must not be negative HOT 1
- Grid with item details opened- after item deleting and grid refreshing attribute 'details-opened' stays in a row
- Client-side exception thrown when hiding column, add item, and refresh data provider HOT 4
- Grid: AppendFooterRow produces an Error when appending more than 8 FooterRows HOT 1
- TreeGrid regression regarding garbled scrolling output HOT 3
- Vaadin-grid horizontal scroll issue in iOS 14 HOT 15
- Getter for grid's selection mode HOT 2
- Sorting indicators are not preserved when column order is changed using Grid#setColumnOrder
- Grid throws UnsupportedOperationException if buffered editor is open during PreserveOnRefresh HOT 4
- Grid column width is calculated wrong on Safari 14.0.3 (Big Sur) HOT 6
- GridPro "out of memory" on Firefox facing 1k Strings HOT 3
- TypeError: Cannot read properties of undefined (reading '_content') in Chrome Browser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vaadin-grid.