Coder Social home page Coder Social logo

Comments (4)

Saulis avatar Saulis commented on July 29, 2024

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.

erinhong17 avatar erinhong17 commented on July 29, 2024

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.

tomivirkki avatar tomivirkki commented on July 29, 2024

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.

jouni avatar jouni commented on July 29, 2024

Wontfix, the workaround should be sufficient.

from vaadin-grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.