jQuery in Action, 2nd edition*
The moose likes HTML, CSS and JavaScript and the fly likes selecting dynamically added rows of  a table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "selecting dynamically added rows of  a table" Watch "selecting dynamically added rows of  a table" New topic
Author

selecting dynamically added rows of a table

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
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 :
----------------------------



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: selecting dynamically added rows of a table