Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

get the selected row value from the icon which is within

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a table and when clicked on a row, that row will be highlighted, then I click a button to create a child window with clicked row information filled in it. The way to know values in selected row is because I can find out by looking for highlight class attributes associated with the table cells.

Now when I add a popup icon to each row, and want to click it to open a child window, there is no row being clicked, so I can't get the selected row values. The popup icon is within the row. But when I click the icon, its row is not actually selected. Does someone know how to solve this problem? I want to know how to get the row values whose icon inside is clicked.

Thanks.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See if one of these would work in the button click event

alert(this.offsetParent.offsetParent.id);
alert(this.parentNode.parentNode.id);

Eric
 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric,

My table has a structure like <table><tr><td>, where popup icon is in <td>

If I use this alert(this.offsetParent.offsetParent.id);
I will get table id

If I use alert(this.offsetParent.id);
I will get td id

I tried alert(this.offsetParent.parentNode.id);
Then finally I got tr id.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic