Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically Scrolling to the newly added row in HTML table.

 
Anurag Mishra
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a table in Iframe, I am adding the rows in the table dynamically.
I want the newly added row to be Visible/(to be scrolled) in the page.

If anyone knows this ? I tried the scrollIntoView() method of Ie but its not working..

Any Ideas??

Thanks in advance.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this table row is there any form elements? If there is there is a simple solution of calling a form element and setting its focus.

Eric
 
Anurag Mishra
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

Thanks for the reply but the focus won't scroll in the table rows and display the newly created row which I have added dynamically.
I tried to ficus that row by assigning one Id to the slement in the row but it did't worked.

Do you have some other idea.

thanks.
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anurag...

May be this answers your question....

I have an application wherei generate rows dynamically, using the "inerHTML" option. I generate som number of rows into a div. Once the row count is more than three, i am setting a scrollbar, in that particular portion of the HTML page.

Is this what you mean by "to be scrolled"?

Cheers,
Swamy
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swamy, that is not what is happening here..


Try playing with this code that I just wrote...



Eric
 
Anurag Mishra
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric and Swamy thanks a lot for your reply I will work with your suggestions.

thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic