Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

selecting dynamically added rows of a table

 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table with header and the rows are added to the table through a Javascript.

The call is as follows...




In the below Javascript I am trying to differentiate the scanning of rows in the table by writing a function which would give a green on a mouseover/click and white for mouse out...

The problem with my code is everytime I add a row I can do mouseover/out/click only for the recently added row.For example I added 9 rows and I add the 10th row I can do mouseover/out/click only for the 10th row where as I need the whole table to be scanned and onclick should be able to listen to that row to set its values in DB...

Help me with this... If it's incorrect please provide any existing codes related to this...I am struggling with this for past 5 days to make it work...Thank you!!!


The Javascript is :
----------------------------



 
Marshal
Posts: 67496
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your use of global variables, specifically vocabBody is biting you in the rear.

Have you considered the use of a modern JavaScript library like jQuery or Dojo to vastly simplify your script?
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No . It would be great if you could give some inputs on them as I have the least idea. I need to finish it by EOD Hope I could learn and implement quickly.
Some notes or saple codes on same would be great.thank you!
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic