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

selecting dynamically added rows of a table

 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :
----------------------------



 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic