• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
What are you doing in my house? Get 'em tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic